-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1652 from ably/test-improvements
test: test ux improvements
- Loading branch information
Showing
21 changed files
with
216 additions
and
579 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const config = { | ||
require: ['source-map-support/register', 'test/support/modules_helper.js', 'test/support/test_helper.js'], | ||
file: ['test/support/root_hooks.js'], | ||
reporter: 'test/support/mocha_reporter.js', | ||
}; | ||
|
||
// mocha has a ridiculous issue (https://github.com/mochajs/mocha/issues/4100) that command line | ||
// specs don't override config specs; they are merged instead, so you can't run a single test file | ||
// if you've defined specs in your config. therefore we work around it by only adding specs to the | ||
// config if none are passed as arguments | ||
if (!process.argv.slice(2).some(isTestFile)) { | ||
config.spec = ['test/realtime/*.test.js', 'test/rest/*.test.js']; | ||
} | ||
|
||
function isTestFile(arg) { | ||
return arg.match(/\.test.js$/); | ||
} | ||
|
||
module.exports = config; |
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
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
Oops, something went wrong.