Skip to content

Commit 191fa02

Browse files
chore: replace mocha.opts with .mocharc.js for packages that are mocha version 6+ (#31518)
* chore: replace mocha.opts with .mocharc.js for packages that are mocha version 6+ * move the mocharc file into the package root * fix mocha reporter config location * fix route to reporter-config * store artifacts for unit tests * move cli mocharc file to root of package * remove storing artifacts * remove js extension from errors mocharc
1 parent a50012b commit 191fa02

File tree

8 files changed

+28
-16
lines changed

8 files changed

+28
-16
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Cached Theme Material Design.pak
2020
packages/data-context/src/**/*.js
2121
packages/errors/src/**/*.js
2222
packages/errors/test/**/*.js
23+
!packages/errors/test/.mocharc.js
2324

2425
# from driver
2526
packages/driver/cypress/videos

cli/.mocharc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
spec: 'test/**/*_spec.js',
3+
timeout: 10000,
4+
reporter: 'spec',
5+
recursive: true
6+
}

cli/test/mocha.opts

-4
This file was deleted.

packages/errors/.mocharc.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
spec: 'test/unit/*.ts',
3+
require: '@packages/ts/register',
4+
recursive: true,
5+
extension: ['ts'],
6+
reporter: 'mocha-multi-reporters',
7+
reporterOptions: {
8+
configFile: '../../mocha-reporter-config.json'
9+
},
10+
exit: true
11+
}

packages/errors/test/mocha.opts

-7
This file was deleted.

packages/network/.mocharc.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
spec: [
3+
'test/unit/**/*.ts',
4+
'test/integration/**/*.ts'
5+
],
6+
require: '../web-config/node-register',
7+
timeout: 10000,
8+
recursive: true
9+
}

packages/network/test/mocha.opts

-5
This file was deleted.

packages/rewriter/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@cypress/request-promise": "^5.0.0",
2828
"@types/parse5-html-rewriting-stream": "5.1.1",
2929
"fs-extra": "9.1.0",
30+
"mocha": "3.5.3",
3031
"nock": "13.2.9",
3132
"sinon": "9.0.2",
3233
"sinon-chai": "3.5.0",

0 commit comments

Comments
 (0)