Created
June 17, 2014 20:21
-
-
Save mxriverlynn/c554b79e8a8f3b583dbe to your computer and use it in GitHub Desktop.
unit testing browserify modules in a (headless) browser
This file contains 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
module.exports = function(grunt){ | |
grunt.initConfig({ | |
// ... | |
browserify: { | |
specs: { | |
src: ["web/specs/**/*Specs.js"], | |
dest: "web/public/build/specs.js", | |
options: { | |
bundleOptions: { | |
debug: epa.debug | |
} | |
} | |
} | |
} | |
// ... | |
}); | |
}; |
This file contains 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
module.exports = function(grunt){ | |
grunt.initConfig({ | |
// ... | |
jasmine: { | |
dev: { | |
src: ["web/public/build/infrastructure.js"], | |
options: { | |
specs: "web/public/build/specs.js" | |
} | |
} | |
} | |
// ... | |
}); | |
}; |
This file contains 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 Patient = require("../public/app/estimate/patient"); | |
describe("patient", function(){ | |
beforeEach(function(){ | |
this.patient = new Patient({ | |
name: "Joe Schmoe", | |
city: "asdf" | |
}); | |
}); | |
it("should have name", function(){ | |
expect(this.patient.get("name")).toBe("Joe Schmoe"); | |
}); | |
it("should have city", function(){ | |
expect(this.patient.get("city")).toBe("asdf"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment