Skip to content

Instantly share code, notes, and snippets.

@travisperson
Created February 10, 2015 23:28
Show Gist options
  • Save travisperson/328381f4ea9a7deac3f2 to your computer and use it in GitHub Desktop.
Save travisperson/328381f4ea9a7deac3f2 to your computer and use it in GitHub Desktop.
//./spec/support/jasmine.json
{
"spec_dir": "spec",
"spec_files": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
]
}
~/t/test $ cat ~/local/lib/node_modules/jasmine/package.json | grep version
"version": "2.2.0",
~/t/test $ jasmine
Started
F
Failures:
1) Include helpers should have foo defined
Message:
Expected 'undefined' to be 'function'.
Stack:
Error: Expected 'undefined' to be 'function'.
at Object.<anonymous> (/home/tperson/tmp/test/spec/spec.js:3:28)
1 spec, 1 failure
Finished in 0.004 seconds
~/t/test $
//./spec/spec.js
describe('Include helpers', function () {
it('should have foo defined', function () {
expect(typeof foo).toBe('function')
})
})
//./spec/helpers/test_helper.js
module.exports = {
foo: function () {
return 'bar';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment