-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build UMD bundle and polyfill language features #4366
Conversation
@Munter I found that when using using object spread syntax I think even the |
update: the |
looks like I jumped the gun a little there. it worked for a test file anyway (as created by |
alright, tweaked the exports. it's now mocha.Mocha = Mocha;
mocha.mocha = mocha;
module.exports = Object.assign(mocha, global); |
AMD bundle seems to "work" per manual test, but the failing test isn't of much value. |
added a proper test for AMD; closes #2426 |
karma.conf.js
Outdated
@@ -134,19 +135,38 @@ module.exports = config => { | |||
{pattern: 'test/browser-specific/esm.spec.mjs', type: 'module'} | |||
]; | |||
break; | |||
case 'requirejs': | |||
cfg.plugins.push('karma-requirejs'); | |||
cfg.frameworks.unshift('requirejs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does order matter? I have no idea
karma.conf.js
Outdated
require.resolve('./test/browser-specific/setup') | ||
); | ||
if (MOCHA_TEST !== 'requirejs') { | ||
cfg.files.unshift( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unexpected is broken when used with AMD. something about mismatched defines
@Munter something is not pulling in the target browser list here |
wow, it works! |
81339e5
to
063689a
Compare
@@ -496,11 +496,11 @@ describe('lib/utils', function() { | |||
if (typeof global.Symbol === 'function') { | |||
it('should handle Symbol', function() { | |||
var symbol = Symbol('value'); | |||
expect(stringify(symbol), 'to be', 'Symbol(value)'); | |||
expect(stringify(symbol), 'to match', /^Symbol\(value\)/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core-js
adds weird characters to the Symbol
string representation in IE11. 🤷♂️
karma.conf.js
Outdated
@@ -17,7 +17,7 @@ const browserPlatformPairs = { | |||
}; | |||
|
|||
module.exports = config => { | |||
let bundleDirpath; | |||
let bundleDirpath = path.join(baseBundleDirpath, hostname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previously, this would have been added to the cfg
object before it was defined. now, we only add it if creating the directory succeeds.
maybe we should ignore a mkdir
failure and just use the tmp dir... I don't want to run the build again 😜
<script> | ||
mocha.setup('bdd'); | ||
</script> | ||
<script src="tests.spec.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was wrong.
we should run linkcheck on this thing.
- removed dead code in `lib/cli/run-helpers.js` - be sure not to send certain options to the worker processes - fix root hook bug in worker - send global fixtures to `Runner` constructor - removed debugs - **add `Process.unhandledRejection` listeners** which might be bad - fix some tests while I'm fixing tests
@@ -49,7 +49,7 @@ jobs: | |||
node_js: '10' | |||
name: 'Node.js v10' | |||
|
|||
- script: npm start test.bundle test.browser | |||
- script: npm start test.browser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test.bundle
becomes test.browser.requirejs
- removed dead code in `lib/cli/run-helpers.js` - be sure not to send certain options to the worker processes - fix root hook bug in worker - send global fixtures to `Runner` constructor - removed debugs - **add `Process.unhandledRejection` listeners** which might be bad - fix some tests while I'm fixing tests
- removed dead code in `lib/cli/run-helpers.js` - be sure not to send certain options to the worker processes - fix root hook bug in worker - send global fixtures to `Runner` constructor - removed debugs - **add `Process.unhandledRejection` listeners** which might be bad - fix some tests while I'm fixing tests
- removed dead code in `lib/cli/run-helpers.js` - be sure not to send certain options to the worker processes - fix root hook bug in worker - send global fixtures to `Runner` constructor - removed debugs - **add `Process.unhandledRejection` listeners** which might be bad - fix some tests while I'm fixing tests
- remove old ESlint rule to disallow `Object.assign` - consume Rollup config's `output` prop in `karma-rollup-plugin` - simplify `rollup.config.js` `output` prop - fix invalid `script` tag `src` attrib in `lib/browser/template.html` (& reformat)
- fix broken bundle output path
- remove the old `bundle/amd.spec.js` test - _actually_ fix bundle output file path - fix a typo in karma rollup plugin
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
- `unexpected`, `unexpected-eventemitter`, and `unexpected-sinon` are now external (not bundled) and loaded via their globals - modified `test/browser-specific/setup.js` to use `require()` since we can do that now - bundle now has an inline source map since I couldn't figure out any other way to load it - removed duplication of work in the karma plugin; no call to `bundle.generate()` is needed. furthermore the `code` prop did not include the inline source maps. so we just write the file and read the result. could probably avoid reading the file by manually stitching the `code` and `map` props together, but I'm unsure how - loads `mocha.js.map`
0cce38e
to
2cf235b
Compare
@boneskull I can't review this PR explained by my complete incompetence in this matter, sorry. |
our browserify bundle is not quite UMD, but it 1. defines globals and 2. enables bundling of the bundle. it does not supply a AMD-compatible bundle, but it also does not inhibit AMD bundles. The rationale for this PR, then, is:
with this PR--for whatever reason--the resulting bundle size is about 20Kb less. |
that said, this has been sitting for like 3 weeks, and I need to move forward with it to get global fixtures in. |
- adds a generic "plugin loader" which handles root hooks, global setup/teardown, future - renamed `validatePlugin` to `validateLegacyPlugin`. reporters/interfaces should eventually be refactored to use this plugin system - should maybe decouple plugins from the `Mocha` prototype - new events emitted by `Runner` for global setup/teardown - need to add unit tests, need to support parallel mode upgrade eslint-config-semistandard more implementation, tests added more tests, implementation. needs #4366 for browser compat - removed dead code in `lib/cli/run-helpers.js` - be sure not to send certain options to the worker processes - fix root hook bug in worker - send global fixtures to `Runner` constructor - removed debugs - **add `Process.unhandledRejection` listeners** which might be bad - fix some tests while I'm fixing tests reorganize plugin fixtures add "to contain once" mocha result output assertion (to ensure some output is not duplicated) add runGlobalSetup, runGlobalTeardown to Mocha revert changes to Runner `Mocha` will handle global fixtures no events will be emitted remove test/integration/options/require.spec.js which is now in test/integration/plugins/ revert change to ParallelBufferedRunner which invoked global fixtures pull helper code out of test/integration/options/watch.spec.js into integration test helpers - because it's nice to be able to test watching elsewhere - also renamed `runMochaWatch` to `runMochaWatchJSON` and provide `runMochaWatch` for plain output move tests from test/integration/options/require.spec.js into test/integration/plugins/root-hooks.spec.js Mocha#run now runs global fixtures; add watch mode support - add `enableGlobalSetup()` and `enableGlobalTeardown()` methods on `Mocha` - update `globalSetup()` and `globalTeardown()` methods - watch mode runs global teardown upon `SIGINT`. is that right? add command prop to runMochaJSON return value if a fixture run with `runMochaJSON()` fails, the return value now contains a `command` prop (like the result of `runMocha()`) for easier debugging remove unused garbage from RUnner fix bug where mocha would never exit with a non-zero code - I think this is understandable, because `done()` is weirdly _not_ an error-first callback - remove try/catch guards around fixtures and let `process` uncaught/unhandled listeners deal w/ it - also fix `unit/mocha.spec.js` test update package-lock.json move plugin.spec.js into node tests for now remove unused 'watchify', add 'touch' Signed-off-by: Christopher Hiller <boneskull@boneskull.com> remove noisy debugs in Runner fix flaky test in test/unit/mocha.spec.js rename assertion types - `JSONRunResult` -> `JSONResult` - `RawRunResult` -> `SummarizedResult` - `RawResult` remains the same - tweak identification functions integration test helper improvements - better organization - renamed stuff for consistency - `runMochaWatch` -> `runMochaWatchAsync` - `splitRegExp` -> `SPLIT_DOT_REPORTER_REGEXP` - rename parameters, add and fix docstrings - modernize some of it - add various typedefs to align with assertion types - remove `invokeSubMocha` as it is no longer needed now that `mocha` will not fork a process if no `node` options are provided - add special case for _forking_ mocha on win32 in watch mode, as that's the only way we can cleanup cleanly (parallel runs will need this treatment too, but I think it demands a more generalized solution) - fix potential bug in `resolveFixturePath()` - in `runMochaWatchAsync`, add `sleepMs` option; defaults to 2s - extract `createTempDir()` from various test files and expose on helper - prefer `rimraf` over `fs-extra.remove` since the former will retry when dir is locked on win32 - expose `touchFile()` on helper; do not use wonky handrolled touching algorithms and use [touch](https://npm.im/touch) instead - update tests to use new helpers and renamed helpers watch improvements and refactors - print "waiting" msg to stderr (_should_ be ok) - add "cleaning up" message upon ctrl-c - remove needless `afterRun` option from various places - only run teardown fixtures if they exist - add win32 fix for testing - add `Mocha#hasGlobalSetupFixtures()` and `Mocha#hasGlobalTeardownFixtures()` more tests Signed-off-by: Christopher Hiller <boneskull@boneskull.com> upgrade rewiremock Signed-off-by: Christopher Hiller <boneskull@boneskull.com> rename lib/plugin => lib/plugin-loader - rename `createInvalidPluginError` => `createInvalidLegacyPluginError` and soft-deprecate - add `createInvalidPluginDefinitionError` and `createInvalidPluginImplementationError` w/ constants; use them - move some typedefs into `lib/mocha.js` as they are referenced via public aforementioned error factories - remove TS docstrings - better coverage - move `plugin-loader` test back into `test/unit` (removed rewiremock from it)
- adds a generic "plugin loader" which handles root hooks, global setup/teardown, future - renamed `validatePlugin` to `validateLegacyPlugin`. reporters/interfaces should eventually be refactored to use this plugin system - should maybe decouple plugins from the `Mocha` prototype - new events emitted by `Runner` for global setup/teardown - need to add unit tests, need to support parallel mode upgrade eslint-config-semistandard more implementation, tests added more tests, implementation. needs #4366 for browser compat - removed dead code in `lib/cli/run-helpers.js` - be sure not to send certain options to the worker processes - fix root hook bug in worker - send global fixtures to `Runner` constructor - removed debugs - **add `Process.unhandledRejection` listeners** which might be bad - fix some tests while I'm fixing tests reorganize plugin fixtures add "to contain once" mocha result output assertion (to ensure some output is not duplicated) add runGlobalSetup, runGlobalTeardown to Mocha revert changes to Runner `Mocha` will handle global fixtures no events will be emitted remove test/integration/options/require.spec.js which is now in test/integration/plugins/ revert change to ParallelBufferedRunner which invoked global fixtures pull helper code out of test/integration/options/watch.spec.js into integration test helpers - because it's nice to be able to test watching elsewhere - also renamed `runMochaWatch` to `runMochaWatchJSON` and provide `runMochaWatch` for plain output move tests from test/integration/options/require.spec.js into test/integration/plugins/root-hooks.spec.js Mocha#run now runs global fixtures; add watch mode support - add `enableGlobalSetup()` and `enableGlobalTeardown()` methods on `Mocha` - update `globalSetup()` and `globalTeardown()` methods - watch mode runs global teardown upon `SIGINT`. is that right? add command prop to runMochaJSON return value if a fixture run with `runMochaJSON()` fails, the return value now contains a `command` prop (like the result of `runMocha()`) for easier debugging remove unused garbage from RUnner fix bug where mocha would never exit with a non-zero code - I think this is understandable, because `done()` is weirdly _not_ an error-first callback - remove try/catch guards around fixtures and let `process` uncaught/unhandled listeners deal w/ it - also fix `unit/mocha.spec.js` test update package-lock.json move plugin.spec.js into node tests for now remove unused 'watchify', add 'touch' Signed-off-by: Christopher Hiller <boneskull@boneskull.com> remove noisy debugs in Runner fix flaky test in test/unit/mocha.spec.js rename assertion types - `JSONRunResult` -> `JSONResult` - `RawRunResult` -> `SummarizedResult` - `RawResult` remains the same - tweak identification functions integration test helper improvements - better organization - renamed stuff for consistency - `runMochaWatch` -> `runMochaWatchAsync` - `splitRegExp` -> `SPLIT_DOT_REPORTER_REGEXP` - rename parameters, add and fix docstrings - modernize some of it - add various typedefs to align with assertion types - remove `invokeSubMocha` as it is no longer needed now that `mocha` will not fork a process if no `node` options are provided - add special case for _forking_ mocha on win32 in watch mode, as that's the only way we can cleanup cleanly (parallel runs will need this treatment too, but I think it demands a more generalized solution) - fix potential bug in `resolveFixturePath()` - in `runMochaWatchAsync`, add `sleepMs` option; defaults to 2s - extract `createTempDir()` from various test files and expose on helper - prefer `rimraf` over `fs-extra.remove` since the former will retry when dir is locked on win32 - expose `touchFile()` on helper; do not use wonky handrolled touching algorithms and use [touch](https://npm.im/touch) instead - update tests to use new helpers and renamed helpers watch improvements and refactors - print "waiting" msg to stderr (_should_ be ok) - add "cleaning up" message upon ctrl-c - remove needless `afterRun` option from various places - only run teardown fixtures if they exist - add win32 fix for testing - add `Mocha#hasGlobalSetupFixtures()` and `Mocha#hasGlobalTeardownFixtures()` more tests Signed-off-by: Christopher Hiller <boneskull@boneskull.com> upgrade rewiremock Signed-off-by: Christopher Hiller <boneskull@boneskull.com> rename lib/plugin => lib/plugin-loader - rename `createInvalidPluginError` => `createInvalidLegacyPluginError` and soft-deprecate - add `createInvalidPluginDefinitionError` and `createInvalidPluginImplementationError` w/ constants; use them - move some typedefs into `lib/mocha.js` as they are referenced via public aforementioned error factories - remove TS docstrings - better coverage - move `plugin-loader` test back into `test/unit` (removed rewiremock from it)
- adds a generic "plugin loader" which handles root hooks, global setup/teardown, future - renamed `validatePlugin` to `validateLegacyPlugin`. reporters/interfaces should eventually be refactored to use this plugin system - should maybe decouple plugins from the `Mocha` prototype - new events emitted by `Runner` for global setup/teardown - need to add unit tests, need to support parallel mode upgrade eslint-config-semistandard more implementation, tests added more tests, implementation. needs #4366 for browser compat - removed dead code in `lib/cli/run-helpers.js` - be sure not to send certain options to the worker processes - fix root hook bug in worker - send global fixtures to `Runner` constructor - removed debugs - **add `Process.unhandledRejection` listeners** which might be bad - fix some tests while I'm fixing tests reorganize plugin fixtures add "to contain once" mocha result output assertion (to ensure some output is not duplicated) add runGlobalSetup, runGlobalTeardown to Mocha revert changes to Runner `Mocha` will handle global fixtures no events will be emitted remove test/integration/options/require.spec.js which is now in test/integration/plugins/ revert change to ParallelBufferedRunner which invoked global fixtures pull helper code out of test/integration/options/watch.spec.js into integration test helpers - because it's nice to be able to test watching elsewhere - also renamed `runMochaWatch` to `runMochaWatchJSON` and provide `runMochaWatch` for plain output move tests from test/integration/options/require.spec.js into test/integration/plugins/root-hooks.spec.js Mocha#run now runs global fixtures; add watch mode support - add `enableGlobalSetup()` and `enableGlobalTeardown()` methods on `Mocha` - update `globalSetup()` and `globalTeardown()` methods - watch mode runs global teardown upon `SIGINT`. is that right? add command prop to runMochaJSON return value if a fixture run with `runMochaJSON()` fails, the return value now contains a `command` prop (like the result of `runMocha()`) for easier debugging remove unused garbage from RUnner fix bug where mocha would never exit with a non-zero code - I think this is understandable, because `done()` is weirdly _not_ an error-first callback - remove try/catch guards around fixtures and let `process` uncaught/unhandled listeners deal w/ it - also fix `unit/mocha.spec.js` test update package-lock.json move plugin.spec.js into node tests for now remove unused 'watchify', add 'touch' Signed-off-by: Christopher Hiller <boneskull@boneskull.com> remove noisy debugs in Runner fix flaky test in test/unit/mocha.spec.js rename assertion types - `JSONRunResult` -> `JSONResult` - `RawRunResult` -> `SummarizedResult` - `RawResult` remains the same - tweak identification functions integration test helper improvements - better organization - renamed stuff for consistency - `runMochaWatch` -> `runMochaWatchAsync` - `splitRegExp` -> `SPLIT_DOT_REPORTER_REGEXP` - rename parameters, add and fix docstrings - modernize some of it - add various typedefs to align with assertion types - remove `invokeSubMocha` as it is no longer needed now that `mocha` will not fork a process if no `node` options are provided - add special case for _forking_ mocha on win32 in watch mode, as that's the only way we can cleanup cleanly (parallel runs will need this treatment too, but I think it demands a more generalized solution) - fix potential bug in `resolveFixturePath()` - in `runMochaWatchAsync`, add `sleepMs` option; defaults to 2s - extract `createTempDir()` from various test files and expose on helper - prefer `rimraf` over `fs-extra.remove` since the former will retry when dir is locked on win32 - expose `touchFile()` on helper; do not use wonky handrolled touching algorithms and use [touch](https://npm.im/touch) instead - update tests to use new helpers and renamed helpers watch improvements and refactors - print "waiting" msg to stderr (_should_ be ok) - add "cleaning up" message upon ctrl-c - remove needless `afterRun` option from various places - only run teardown fixtures if they exist - add win32 fix for testing - add `Mocha#hasGlobalSetupFixtures()` and `Mocha#hasGlobalTeardownFixtures()` more tests Signed-off-by: Christopher Hiller <boneskull@boneskull.com> upgrade rewiremock Signed-off-by: Christopher Hiller <boneskull@boneskull.com> rename lib/plugin => lib/plugin-loader - rename `createInvalidPluginError` => `createInvalidLegacyPluginError` and soft-deprecate - add `createInvalidPluginDefinitionError` and `createInvalidPluginImplementationError` w/ constants; use them - move some typedefs into `lib/mocha.js` as they are referenced via public aforementioned error factories - remove TS docstrings - better coverage - move `plugin-loader` test back into `test/unit` (removed rewiremock from it)
- adds a generic "plugin loader" which handles root hooks, global setup/teardown, future - renamed `validatePlugin` to `validateLegacyPlugin`. reporters/interfaces should eventually be refactored to use this plugin system - should maybe decouple plugins from the `Mocha` prototype - new events emitted by `Runner` for global setup/teardown - need to add unit tests, need to support parallel mode upgrade eslint-config-semistandard more implementation, tests added more tests, implementation. needs #4366 for browser compat - removed dead code in `lib/cli/run-helpers.js` - be sure not to send certain options to the worker processes - fix root hook bug in worker - send global fixtures to `Runner` constructor - removed debugs - **add `Process.unhandledRejection` listeners** which might be bad - fix some tests while I'm fixing tests reorganize plugin fixtures add "to contain once" mocha result output assertion (to ensure some output is not duplicated) add runGlobalSetup, runGlobalTeardown to Mocha revert changes to Runner `Mocha` will handle global fixtures no events will be emitted remove test/integration/options/require.spec.js which is now in test/integration/plugins/ revert change to ParallelBufferedRunner which invoked global fixtures pull helper code out of test/integration/options/watch.spec.js into integration test helpers - because it's nice to be able to test watching elsewhere - also renamed `runMochaWatch` to `runMochaWatchJSON` and provide `runMochaWatch` for plain output move tests from test/integration/options/require.spec.js into test/integration/plugins/root-hooks.spec.js Mocha#run now runs global fixtures; add watch mode support - add `enableGlobalSetup()` and `enableGlobalTeardown()` methods on `Mocha` - update `globalSetup()` and `globalTeardown()` methods - watch mode runs global teardown upon `SIGINT`. is that right? add command prop to runMochaJSON return value if a fixture run with `runMochaJSON()` fails, the return value now contains a `command` prop (like the result of `runMocha()`) for easier debugging remove unused garbage from RUnner fix bug where mocha would never exit with a non-zero code - I think this is understandable, because `done()` is weirdly _not_ an error-first callback - remove try/catch guards around fixtures and let `process` uncaught/unhandled listeners deal w/ it - also fix `unit/mocha.spec.js` test update package-lock.json move plugin.spec.js into node tests for now remove unused 'watchify', add 'touch' Signed-off-by: Christopher Hiller <boneskull@boneskull.com> remove noisy debugs in Runner fix flaky test in test/unit/mocha.spec.js rename assertion types - `JSONRunResult` -> `JSONResult` - `RawRunResult` -> `SummarizedResult` - `RawResult` remains the same - tweak identification functions integration test helper improvements - better organization - renamed stuff for consistency - `runMochaWatch` -> `runMochaWatchAsync` - `splitRegExp` -> `SPLIT_DOT_REPORTER_REGEXP` - rename parameters, add and fix docstrings - modernize some of it - add various typedefs to align with assertion types - remove `invokeSubMocha` as it is no longer needed now that `mocha` will not fork a process if no `node` options are provided - add special case for _forking_ mocha on win32 in watch mode, as that's the only way we can cleanup cleanly (parallel runs will need this treatment too, but I think it demands a more generalized solution) - fix potential bug in `resolveFixturePath()` - in `runMochaWatchAsync`, add `sleepMs` option; defaults to 2s - extract `createTempDir()` from various test files and expose on helper - prefer `rimraf` over `fs-extra.remove` since the former will retry when dir is locked on win32 - expose `touchFile()` on helper; do not use wonky handrolled touching algorithms and use [touch](https://npm.im/touch) instead - update tests to use new helpers and renamed helpers watch improvements and refactors - print "waiting" msg to stderr (_should_ be ok) - add "cleaning up" message upon ctrl-c - remove needless `afterRun` option from various places - only run teardown fixtures if they exist - add win32 fix for testing - add `Mocha#hasGlobalSetupFixtures()` and `Mocha#hasGlobalTeardownFixtures()` more tests Signed-off-by: Christopher Hiller <boneskull@boneskull.com> upgrade rewiremock Signed-off-by: Christopher Hiller <boneskull@boneskull.com> rename lib/plugin => lib/plugin-loader - rename `createInvalidPluginError` => `createInvalidLegacyPluginError` and soft-deprecate - add `createInvalidPluginDefinitionError` and `createInvalidPluginImplementationError` w/ constants; use them - move some typedefs into `lib/mocha.js` as they are referenced via public aforementioned error factories - remove TS docstrings - better coverage - move `plugin-loader` test back into `test/unit` (removed rewiremock from it)
- adds a generic "plugin loader" which handles root hooks, global setup/teardown, future - renamed `validatePlugin` to `validateLegacyPlugin`. reporters/interfaces should eventually be refactored to use this plugin system - should maybe decouple plugins from the `Mocha` prototype - new events emitted by `Runner` for global setup/teardown - need to add unit tests, need to support parallel mode upgrade eslint-config-semistandard more implementation, tests added more tests, implementation. needs #4366 for browser compat - removed dead code in `lib/cli/run-helpers.js` - be sure not to send certain options to the worker processes - fix root hook bug in worker - send global fixtures to `Runner` constructor - removed debugs - **add `Process.unhandledRejection` listeners** which might be bad - fix some tests while I'm fixing tests reorganize plugin fixtures add "to contain once" mocha result output assertion (to ensure some output is not duplicated) add runGlobalSetup, runGlobalTeardown to Mocha revert changes to Runner `Mocha` will handle global fixtures no events will be emitted remove test/integration/options/require.spec.js which is now in test/integration/plugins/ revert change to ParallelBufferedRunner which invoked global fixtures pull helper code out of test/integration/options/watch.spec.js into integration test helpers - because it's nice to be able to test watching elsewhere - also renamed `runMochaWatch` to `runMochaWatchJSON` and provide `runMochaWatch` for plain output move tests from test/integration/options/require.spec.js into test/integration/plugins/root-hooks.spec.js Mocha#run now runs global fixtures; add watch mode support - add `enableGlobalSetup()` and `enableGlobalTeardown()` methods on `Mocha` - update `globalSetup()` and `globalTeardown()` methods - watch mode runs global teardown upon `SIGINT`. is that right? add command prop to runMochaJSON return value if a fixture run with `runMochaJSON()` fails, the return value now contains a `command` prop (like the result of `runMocha()`) for easier debugging remove unused garbage from RUnner fix bug where mocha would never exit with a non-zero code - I think this is understandable, because `done()` is weirdly _not_ an error-first callback - remove try/catch guards around fixtures and let `process` uncaught/unhandled listeners deal w/ it - also fix `unit/mocha.spec.js` test update package-lock.json move plugin.spec.js into node tests for now remove unused 'watchify', add 'touch' Signed-off-by: Christopher Hiller <boneskull@boneskull.com> remove noisy debugs in Runner fix flaky test in test/unit/mocha.spec.js rename assertion types - `JSONRunResult` -> `JSONResult` - `RawRunResult` -> `SummarizedResult` - `RawResult` remains the same - tweak identification functions integration test helper improvements - better organization - renamed stuff for consistency - `runMochaWatch` -> `runMochaWatchAsync` - `splitRegExp` -> `SPLIT_DOT_REPORTER_REGEXP` - rename parameters, add and fix docstrings - modernize some of it - add various typedefs to align with assertion types - remove `invokeSubMocha` as it is no longer needed now that `mocha` will not fork a process if no `node` options are provided - add special case for _forking_ mocha on win32 in watch mode, as that's the only way we can cleanup cleanly (parallel runs will need this treatment too, but I think it demands a more generalized solution) - fix potential bug in `resolveFixturePath()` - in `runMochaWatchAsync`, add `sleepMs` option; defaults to 2s - extract `createTempDir()` from various test files and expose on helper - prefer `rimraf` over `fs-extra.remove` since the former will retry when dir is locked on win32 - expose `touchFile()` on helper; do not use wonky handrolled touching algorithms and use [touch](https://npm.im/touch) instead - update tests to use new helpers and renamed helpers watch improvements and refactors - print "waiting" msg to stderr (_should_ be ok) - add "cleaning up" message upon ctrl-c - remove needless `afterRun` option from various places - only run teardown fixtures if they exist - add win32 fix for testing - add `Mocha#hasGlobalSetupFixtures()` and `Mocha#hasGlobalTeardownFixtures()` more tests Signed-off-by: Christopher Hiller <boneskull@boneskull.com> upgrade rewiremock Signed-off-by: Christopher Hiller <boneskull@boneskull.com> rename lib/plugin => lib/plugin-loader - rename `createInvalidPluginError` => `createInvalidLegacyPluginError` and soft-deprecate - add `createInvalidPluginDefinitionError` and `createInvalidPluginImplementationError` w/ constants; use them - move some typedefs into `lib/mocha.js` as they are referenced via public aforementioned error factories - remove TS docstrings - better coverage - move `plugin-loader` test back into `test/unit` (removed rewiremock from it)
- adds a generic "plugin loader" which handles root hooks, global setup/teardown, future - renamed `validatePlugin` to `validateLegacyPlugin`. reporters/interfaces should eventually be refactored to use this plugin system - should maybe decouple plugins from the `Mocha` prototype - new events emitted by `Runner` for global setup/teardown - need to add unit tests, need to support parallel mode upgrade eslint-config-semistandard more implementation, tests added more tests, implementation. needs #4366 for browser compat - removed dead code in `lib/cli/run-helpers.js` - be sure not to send certain options to the worker processes - fix root hook bug in worker - send global fixtures to `Runner` constructor - removed debugs - **add `Process.unhandledRejection` listeners** which might be bad - fix some tests while I'm fixing tests reorganize plugin fixtures add "to contain once" mocha result output assertion (to ensure some output is not duplicated) add runGlobalSetup, runGlobalTeardown to Mocha revert changes to Runner `Mocha` will handle global fixtures no events will be emitted remove test/integration/options/require.spec.js which is now in test/integration/plugins/ revert change to ParallelBufferedRunner which invoked global fixtures pull helper code out of test/integration/options/watch.spec.js into integration test helpers - because it's nice to be able to test watching elsewhere - also renamed `runMochaWatch` to `runMochaWatchJSON` and provide `runMochaWatch` for plain output move tests from test/integration/options/require.spec.js into test/integration/plugins/root-hooks.spec.js Mocha#run now runs global fixtures; add watch mode support - add `enableGlobalSetup()` and `enableGlobalTeardown()` methods on `Mocha` - update `globalSetup()` and `globalTeardown()` methods - watch mode runs global teardown upon `SIGINT`. is that right? add command prop to runMochaJSON return value if a fixture run with `runMochaJSON()` fails, the return value now contains a `command` prop (like the result of `runMocha()`) for easier debugging remove unused garbage from RUnner fix bug where mocha would never exit with a non-zero code - I think this is understandable, because `done()` is weirdly _not_ an error-first callback - remove try/catch guards around fixtures and let `process` uncaught/unhandled listeners deal w/ it - also fix `unit/mocha.spec.js` test update package-lock.json move plugin.spec.js into node tests for now remove unused 'watchify', add 'touch' Signed-off-by: Christopher Hiller <boneskull@boneskull.com> remove noisy debugs in Runner fix flaky test in test/unit/mocha.spec.js rename assertion types - `JSONRunResult` -> `JSONResult` - `RawRunResult` -> `SummarizedResult` - `RawResult` remains the same - tweak identification functions integration test helper improvements - better organization - renamed stuff for consistency - `runMochaWatch` -> `runMochaWatchAsync` - `splitRegExp` -> `SPLIT_DOT_REPORTER_REGEXP` - rename parameters, add and fix docstrings - modernize some of it - add various typedefs to align with assertion types - remove `invokeSubMocha` as it is no longer needed now that `mocha` will not fork a process if no `node` options are provided - add special case for _forking_ mocha on win32 in watch mode, as that's the only way we can cleanup cleanly (parallel runs will need this treatment too, but I think it demands a more generalized solution) - fix potential bug in `resolveFixturePath()` - in `runMochaWatchAsync`, add `sleepMs` option; defaults to 2s - extract `createTempDir()` from various test files and expose on helper - prefer `rimraf` over `fs-extra.remove` since the former will retry when dir is locked on win32 - expose `touchFile()` on helper; do not use wonky handrolled touching algorithms and use [touch](https://npm.im/touch) instead - update tests to use new helpers and renamed helpers watch improvements and refactors - print "waiting" msg to stderr (_should_ be ok) - add "cleaning up" message upon ctrl-c - remove needless `afterRun` option from various places - only run teardown fixtures if they exist - add win32 fix for testing - add `Mocha#hasGlobalSetupFixtures()` and `Mocha#hasGlobalTeardownFixtures()` more tests Signed-off-by: Christopher Hiller <boneskull@boneskull.com> upgrade rewiremock Signed-off-by: Christopher Hiller <boneskull@boneskull.com> rename lib/plugin => lib/plugin-loader - rename `createInvalidPluginError` => `createInvalidLegacyPluginError` and soft-deprecate - add `createInvalidPluginDefinitionError` and `createInvalidPluginImplementationError` w/ constants; use them - move some typedefs into `lib/mocha.js` as they are referenced via public aforementioned error factories - remove TS docstrings - better coverage - move `plugin-loader` test back into `test/unit` (removed rewiremock from it)
Object.assign
output
prop inkarma-rollup-plugin
rollup.config.js
output
propscript
tagsrc
attrib inlib/browser/template.html
(& reformat)