Skip to content

Instantly share code, notes, and snippets.

@twolfson
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twolfson/9b769b716dd7bad383ac to your computer and use it in GitHub Desktop.
Save twolfson/9b769b716dd7bad383ac to your computer and use it in GitHub Desktop.
node_modules/
{
"name": "gist-mocha-only",
"version": "1.0.0",
"description": "Proof of concept for https://github.com/mochajs/mocha/issues/1481",
"main": "index.js",
"scripts": {
"test": "mocha test-one.js test-two.js"
},
"repository": {
"type": "git",
"url": "git@gist.github.com:9b769b716dd7bad383ac.git"
},
"author": "Todd Wolfson <todd@twolfson.com> (http://twolfson.com/)",
"license": "UNLICENSE",
"devDependencies": {
"mocha": "~2.1.0"
}
}
// Load in dependencies
var assert = require('assert');
// Start our tests
describe.only('one with a .only', function () {
it('is run separately from other tests', function () {
assert.strictEqual(1, 1);
});
});
// Load in dependencies
var assert = require('assert');
// Start our tests
describe('two without a .only', function () {
it('is not run', function () {
assert.strictEqual(1, 2);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment