[6a3a178] | 1 | var test = require('tape');
|
---|
| 2 | var functionsHaveNames = require('functions-have-names');
|
---|
| 3 | var hasSymbols = require('has-symbols');
|
---|
| 4 |
|
---|
| 5 | require('./legacy-compat');
|
---|
| 6 | var common = require('./common');
|
---|
| 7 |
|
---|
| 8 | // we do this to easily wrap each file in a mocha test
|
---|
| 9 | // and also have browserify be able to statically analyze this file
|
---|
| 10 | var orig_require = require;
|
---|
| 11 | var require = function(file) {
|
---|
| 12 | test(file, function(t) {
|
---|
| 13 | // Store the tape object so tests can access it.
|
---|
| 14 | t.on('end', function () { delete common.test; });
|
---|
| 15 | common.test = t;
|
---|
| 16 |
|
---|
| 17 | try {
|
---|
| 18 | var exp = orig_require(file);
|
---|
| 19 | if (exp && exp.then) {
|
---|
| 20 | exp.then(function () { t.end(); }, t.fail);
|
---|
| 21 | return;
|
---|
| 22 | }
|
---|
| 23 | } catch (err) {
|
---|
| 24 | t.fail(err);
|
---|
| 25 | }
|
---|
| 26 | t.end();
|
---|
| 27 | });
|
---|
| 28 | };
|
---|
| 29 |
|
---|
| 30 | require('./add-listeners.js');
|
---|
| 31 | require('./check-listener-leaks.js');
|
---|
| 32 | require('./errors.js');
|
---|
| 33 | require('./events-list.js');
|
---|
| 34 | if (typeof Promise === 'function') {
|
---|
| 35 | require('./events-once.js');
|
---|
| 36 | } else {
|
---|
| 37 | // Promise support is not available.
|
---|
| 38 | test('./events-once.js', { skip: true }, function () {});
|
---|
| 39 | }
|
---|
| 40 | require('./listener-count.js');
|
---|
| 41 | require('./listeners-side-effects.js');
|
---|
| 42 | require('./listeners.js');
|
---|
| 43 | require('./max-listeners.js');
|
---|
| 44 | if (functionsHaveNames()) {
|
---|
| 45 | require('./method-names.js');
|
---|
| 46 | } else {
|
---|
| 47 | // Function.name is not supported in IE
|
---|
| 48 | test('./method-names.js', { skip: true }, function () {});
|
---|
| 49 | }
|
---|
| 50 | require('./modify-in-emit.js');
|
---|
| 51 | require('./num-args.js');
|
---|
| 52 | require('./once.js');
|
---|
| 53 | require('./prepend.js');
|
---|
| 54 | require('./set-max-listeners-side-effects.js');
|
---|
| 55 | require('./special-event-names.js');
|
---|
| 56 | require('./subclass.js');
|
---|
| 57 | if (hasSymbols()) {
|
---|
| 58 | require('./symbols.js');
|
---|
| 59 | } else {
|
---|
| 60 | // Symbol is not available.
|
---|
| 61 | test('./symbols.js', { skip: true }, function () {});
|
---|
| 62 | }
|
---|
| 63 | require('./remove-all-listeners.js');
|
---|
| 64 | require('./remove-listeners.js');
|
---|