diff options
| author | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
|---|---|---|
| committer | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
| commit | cc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch) | |
| tree | 92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/events/tests/common.js | |
| parent | 3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff) | |
remove node_modules
Diffstat (limited to 'node_modules/events/tests/common.js')
| -rw-r--r-- | node_modules/events/tests/common.js | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/node_modules/events/tests/common.js b/node_modules/events/tests/common.js deleted file mode 100644 index 66f70a390..000000000 --- a/node_modules/events/tests/common.js +++ /dev/null @@ -1,42 +0,0 @@ -var assert = require('assert'); - -var mustCallChecks = []; - -function runCallChecks() { - var failed_count = 0; - for (var i=0 ; i< mustCallChecks.length; ++i) { - var context = mustCallChecks[i]; - if (context.actual === context.expected) { - continue; - } - - failed_count++; - console.log('Mismatched %s function calls. Expected %d, actual %d.', - context.name, - context.expected, - context.actual); - console.log(context.stack.split('\n').slice(2).join('\n')); - } - - assert(failed_count === 0); -} - -after(runCallChecks); - -exports.mustCall = function(fn, expected) { - if (typeof expected !== 'number') expected = 1; - - var context = { - expected: expected, - actual: 0, - stack: (new Error).stack, - name: fn.name || '<anonymous>' - }; - - mustCallChecks.push(context); - - return function() { - context.actual++; - return fn.apply(this, arguments); - }; -}; |
