Skip to content

Commit

Permalink
Cleanup example modules, extend test coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Esser committed Nov 25, 2016
1 parent 5ac1f8e commit c6123de
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 35 deletions.
1 change: 0 additions & 1 deletion lib/fancy-lib.js

This file was deleted.

9 changes: 0 additions & 9 deletions lib/my-module.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/mylib.js

This file was deleted.

15 changes: 0 additions & 15 deletions test/my-module-test.js

This file was deleted.

9 changes: 0 additions & 9 deletions test/mylib-test.js

This file was deleted.

5 changes: 5 additions & 0 deletions test/plugins/close-timestamp-plugin-test.js
Expand Up @@ -5,6 +5,11 @@ const timedifferenceLimit = 600
const uploadTimestamp = 1478886423.003

buster.testCase('Input Scorer', {
'should use time limit from param if set': function () {
const taskTimestamp = uploadTimestamp - 1234 / 2
let result = plugin(uploadTimestamp, taskTimestamp, { 'time-limit': 1234 })
buster.assert.equals(result, 0.5)
},
'should return 1.0 when timing matches exactly': function () {
let result = plugin(uploadTimestamp, uploadTimestamp)
buster.assert.equals(result, 1.0)
Expand Down
7 changes: 7 additions & 0 deletions test/score-manager-test.js
Expand Up @@ -201,6 +201,13 @@ buster.testCase('ScoreManager with configuration', {

let scores = manager.score({ x: {}, y: [0] })
buster.assert.equals(scores, [{ 'total': 0.8, 'plugin-a': 0.5, 'plugin-b': 0.8 }])
},

'should throw an error if no aggregator by that name exists': function () {
this.stubPluginA.returns(0.5)
this.stubPluginB.returns(0.8)
this.config.aggregator = 'no-aggregator-here'
buster.assert.exception(() => scoreManager.create(this.config))
}
},

Expand Down

0 comments on commit c6123de

Please sign in to comment.