forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for subtract, sum and title
- Loading branch information
Rashid Khan
committed
May 10, 2016
1 parent
a2e693e
commit 4ddf80d
Showing
4 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const filename = require('path').basename(__filename); | ||
const fn = require(`../${filename}`); | ||
|
||
const _ = require('lodash'); | ||
const expect = require('chai').expect; | ||
const invoke = require('./helpers/invoke_series_fn.js'); | ||
|
||
describe(filename, () => { | ||
|
||
let seriesList; | ||
beforeEach(() => { | ||
seriesList = require('./fixtures/seriesList.js')(); | ||
}); | ||
|
||
it('it subtracts a number', () => { | ||
return invoke(fn, [seriesList, 2]).then((r) => { | ||
expect(_.map(r.output.list[1].data, 1)).to.eql([98, 48, 48, 18]); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const filename = require('path').basename(__filename); | ||
const fn = require(`../${filename}`); | ||
|
||
const _ = require('lodash'); | ||
const expect = require('chai').expect; | ||
const invoke = require('./helpers/invoke_series_fn.js'); | ||
|
||
describe(filename, () => { | ||
|
||
let seriesList; | ||
beforeEach(() => { | ||
seriesList = require('./fixtures/seriesList.js')(); | ||
}); | ||
|
||
it('it adds a number', () => { | ||
return invoke(fn, [seriesList, 2]).then((r) => { | ||
expect(_.map(r.output.list[1].data, 1)).to.eql([102, 52, 52, 22]); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const filename = require('path').basename(__filename); | ||
const fn = require(`../${filename}`); | ||
|
||
const _ = require('lodash'); | ||
const expect = require('chai').expect; | ||
const invoke = require('./helpers/invoke_series_fn.js'); | ||
|
||
describe(filename, () => { | ||
|
||
let seriesList; | ||
beforeEach(() => { | ||
seriesList = require('./fixtures/seriesList.js')(); | ||
}); | ||
|
||
it('sets the title property', () => { | ||
return invoke(fn, [seriesList, 'beer']).then((r) => { | ||
_.each(r.output.list, (series) => expect(series._title).to.equal('beer')); | ||
}); | ||
}); | ||
|
||
}); |