Skip to content

Instantly share code, notes, and snippets.

@mxriverlynn
Created June 17, 2014 20:21
Show Gist options
  • Save mxriverlynn/c554b79e8a8f3b583dbe to your computer and use it in GitHub Desktop.
Save mxriverlynn/c554b79e8a8f3b583dbe to your computer and use it in GitHub Desktop.
unit testing browserify modules in a (headless) browser
module.exports = function(grunt){
grunt.initConfig({
// ...
browserify: {
specs: {
src: ["web/specs/**/*Specs.js"],
dest: "web/public/build/specs.js",
options: {
bundleOptions: {
debug: epa.debug
}
}
}
}
// ...
});
};
module.exports = function(grunt){
grunt.initConfig({
// ...
jasmine: {
dev: {
src: ["web/public/build/infrastructure.js"],
options: {
specs: "web/public/build/specs.js"
}
}
}
// ...
});
};
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