Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rttomlinson/874872ee821e95d677c47b5a6cb6af4d to your computer and use it in GitHub Desktop.

Select an option

Save rttomlinson/874872ee821e95d677c47b5a6cb6af4d to your computer and use it in GitHub Desktop.
Jasmine Boiler Plate
/*
Expected File tree:
spec/
helpers/
spec_helper.js
support/
jasmine.json
spec.js
*/
//spec_helper.js
process.env.NODE_ENV = 'test';
beforeAll((done) => {
done();
});
beforeEach((done) => {
done();
});
afterEach((done) => {
done();
});
afterAll((done) => {
done();
});
//support/jasmine.json
{
"spec_dir": "spec",
"spec_files": [
"**/*[sS]pec.js"
],
"helpers": [
"../../node_modules/jasmine-es6/lib/install.js",
"helpers/**/*.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}
//spec.js
describe();
//Helpful package.json scripts
"test-jasmine-es6": "npm run nodemon --exec ./node_modules/jasmine-es6/bin/jasmine.js",
"nodemon": "./node_modules/nodemon/bin/nodemon.js"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment