Last active
October 12, 2015 19:18
-
-
Save KylePDavis/4074607 to your computer and use it in GitHub Desktop.
Self-hosted Mocha Test Case Template
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
"use strict"; | |
// Mocha one-liner to make these tests self-hosted | |
if (!module.parent) return require.cache[__filename] = 0, (new(require("mocha"))()).addFile(__filename).ui("exports").run(process.exit); | |
// requires | |
var assert = require("assert"), | |
MyClass = require("../../lib/MyClass"); | |
// tests | |
exports.MyClass = { | |
"#constructor": { | |
"should not throw Error": function(){ | |
assert.doesNotThrow(function(){ | |
new MyClass() | |
}); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment