Last active
August 29, 2015 14:18
-
-
Save NickHeiner/21048fc2f90c9568bbb4 to your computer and use it in GitHub Desktop.
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
// app code file | |
// app/utils/get-greeting.js | |
const constants = require('../constants'); | |
module.exports = function getGreeting(name) { | |
return CONSTANTS.GREETING_PREFIX + name; | |
} | |
// test code file snippet | |
// test/utils/get-greeting.test.js | |
const constants = require('../../app/constants'); | |
expect(getGreeting('Sam')).to.equal(CONSTANTS.GREETING_PREFIX + 'Sam'); | |
// constants file | |
// app/constants.js | |
module.exports = {GREETING_PREFIX: 'Hi, '}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment