Created
December 24, 2015 21:33
-
-
Save anonymous/0926fa969bf6d7d80391 to your computer and use it in GitHub Desktop.
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 assert = require('assert'); | |
var a = require('./a'); | |
suite("A", function() { | |
test("a", function() { | |
a.sub(function() { | |
assert.ok(true); | |
}); | |
a.trigger(); | |
}); | |
}); |
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 targets = []; | |
module.exports = { | |
sub: function(fn) { | |
targets.push(fn); | |
}, | |
trigger: function(v) { | |
targets.forEach(function(fn) { | |
fn(v); | |
}); | |
} | |
}; |
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 assert = require('assert'); | |
var b = require('./b'); | |
suite("B", function() { | |
test("b", function() { | |
assert.ok(true); | |
}); | |
}); |
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 assert = require('assert'); | |
var a = require('./a'); | |
a.sub(bad); | |
function bad() { | |
assert(false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment