Skip to content

Instantly share code, notes, and snippets.

@mckoss
Forked from anonymous/a-test.js
Last active December 24, 2015 22:03
Show Gist options
  • Save mckoss/d5864a953365040c5cae to your computer and use it in GitHub Desktop.
Save mckoss/d5864a953365040c5cae to your computer and use it in GitHub Desktop.
var assert = require('assert');
var a = require('./a');
suite("A", function() {
test("a", function() {
a.sub(function() {
assert.ok(true);
});
a.trigger();
});
});
var targets = [];
module.exports = {
sub: function(fn) {
targets.push(fn);
},
trigger: function(v) {
targets.forEach(function(fn) {
fn(v);
});
}
};
var assert = require('assert');
var b = require('./b');
suite("B", function() {
test("b", function() {
assert.ok(true);
});
});
var assert = require('assert');
var a = require('./a');
a.sub(bad);
function bad() {
assert(false);
}
#!/bin/bash
echo Tests run separately...
mocha --ui tdd a-test
mocha --ui tdd b-test
echo Tests run together...
mocha --ui tdd .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment