Last active
August 29, 2015 14:02
-
-
Save ianstormtaylor/8620c70da1fffaa2de6d to your computer and use it in GitHub Desktop.
This is the normal way that Duo tests would be created for modules. It's testing the logic inside the module itself, but it's not testing the actual "built" file.
This file contains hidden or 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
{ | |
"name": "to-slug-case", | |
"dependencies": { | |
"ianstormtaylor/to-no-case": "1.x" | |
}, | |
"development": { | |
"component/assert": "0.x" | |
} | |
} |
This file contains hidden or 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
var clean = require('ianstormtaylor/to-no-case'); | |
module.exports = function(input){ | |
return clean(input).replace(/ /g, '-'); | |
} |
This file contains hidden or 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
build-test.js: index.js test.js | |
duo test.js > build-test.js | |
test: build-test.js | |
mocha build-test.js |
This file contains hidden or 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
var slug = require('..'); | |
var assert = require('component/assert'); | |
// Tests here... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment