Skip to content

Commit

Permalink
Update config file examples (#4225) [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
pkuczynski authored Mar 11, 2021
1 parent 21652d9 commit e9860b3
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 17 deletions.
36 changes: 33 additions & 3 deletions example/config/.mocharc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,47 @@
'use strict';

// Here's a JavaScript-based config file.
// This is a JavaScript-based config file containing every Mocha option plus others.
// If you need conditional logic, you might want to use this type of config.
// Otherwise, JSON or YAML is recommended.

module.exports = {
'allow-uncaught': false,
'async-only': false,
bail: false,
'check-leaks': false,
color: true,
delay: false,
diff: true,
exit: false, // could be expressed as "'no-exit': true"
extension: ['js'],
// fgrep: something, // fgrep and grep are mutually exclusive
file: ['/path/to/some/file', '/path/to/some/other/file'],
'forbid-only': false,
'forbid-pending': false,
'full-trace': false,
global: ['jQuery', '$'],
// grep: something, // fgrep and grep are mutually exclusive
growl: false,
ignore: ['/path/to/some/ignored/file'],
'inline-diffs': false,
// invert: false, // needs to be used with grep or fgrep
jobs: 1,
package: './package.json',
parallel: false,
recursive: false,
reporter: 'spec',
slow: 75,
timeout: 2000,
'reporter-option': ['foo=bar', 'baz=quux'],
require: '@babel/register',
retries: 1,
slow: '75',
sort: false,
spec: ['test/**/*.spec.js'], // the positional arguments!
timeout: '2000', // same as "timeout: '2s'"
// timeout: false, // same as "'no-timeout': true" or "timeout: 0"
'trace-warnings': true, // node flags ok
ui: 'bdd',
'v8-stack-trace-limit': 100, // V8 flags are prepended with "v8-"
watch: false,
'watch-files': ['lib/**/*.js', 'test/**/*.js'],
'watch-ignore': ['lib/vendor']
};
7 changes: 3 additions & 4 deletions example/config/.mocharc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// This config file contains Mocha's defaults.
// As you can see, comments are allowed.
// This same configuration could be provided in the `mocha` property of your
// project's `package.json`.
{
"diff": true,
"extension": ["js"],
"extension": ["js", "cjs", "mjs"],
"package": "./package.json",
"reporter": "spec",
"slow": 75,
"timeout": 2000,
"slow": "75",
"timeout": "2000",
"ui": "bdd",
"watch-files": ["lib/**/*.js", "test/**/*.js"],
"watch-ignore": ["lib/vendor"]
Expand Down
11 changes: 5 additions & 6 deletions example/config/.mocharc.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
// project's `package.json`.
{
"diff": true,
"extension": ["js"],
"extension": ["js","cjs","mjs"],
"package": /* 📦 */ "./package.json",
"reporter": /* 📋 */ "spec",
"slow": 75,
"timeout": 2000,
"slow": "75",
"timeout": "2000",
"ui": "bdd",
// Camel-casing options are also accepted
"watchFiles": ["lib/**/*.js", "test/**/*.js"],
"watchIgnore": ["lib/vendor"]
"watch-files": ["lib/**/*.js", "test/**/*.js"],
"watch-ignore": ["lib/vendor"]
}
13 changes: 9 additions & 4 deletions example/config/.mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is an example Mocha config containing every Mocha option plus others
# This is an example Mocha config containing every Mocha option plus others.
allow-uncaught: false
async-only: false
bail: false
Expand Down Expand Up @@ -28,17 +28,22 @@ ignore:
inline-diffs: false
# needs to be used with grep or fgrep
# invert: false
jobs: 1
package: './package.json'
parallel: false
recursive: false
reporter: 'spec'
reporter-option:
- 'foo=bar'
- 'baz=quux'
require: '@babel/register'
retries: 1
slow: 75
slow: '75'
sort: false
spec: 'test/**/*.spec.js' # the positional arguments!
timeout: false # same as "no-timeout: true" or "timeout: 0"
spec:
- 'test/**/*.spec.js' # the positional arguments!
timeout: '2000' # same as "timeout: '2s'"
# timeout: false # same as "no-timeout: true" or "timeout: 0"
trace-warnings: true # node flags ok
ui: 'bdd'
v8-stack-trace-limit: 100 # V8 flags are prepended with "v8-"
Expand Down

0 comments on commit e9860b3

Please sign in to comment.