@jcoreio/toolchain-mocha 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.cjs +10 -0
- package/bin/mocha +5 -0
- package/bin/nyc +5 -0
- package/bin/resolveBin.cjs +8 -0
- package/nyc.config.cjs +9 -0
- package/package.json +30 -0
- package/plugins/coverage.cjs +7 -0
- package/plugins/getConfigFiles.cjs +19 -0
- package/plugins/mochaSpecs.cjs +5 -0
- package/plugins/test.cjs +7 -0
- package/util/configureMocha.cjs +2 -0
- package/util/mochaWatchClearConsole.cjs +5 -0
package/.mocharc.cjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const getPluginsArraySync = require('@jcoreio/toolchain/util/getPluginsArraySync.cjs')
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
require: [require.resolve('./util/configureMocha.cjs')],
|
|
5
|
+
reporter: 'spec',
|
|
6
|
+
spec: [
|
|
7
|
+
require.resolve('./util/mochaWatchClearConsole.cjs'),
|
|
8
|
+
...getPluginsArraySync('mochaSpecs'),
|
|
9
|
+
],
|
|
10
|
+
}
|
package/bin/mocha
ADDED
package/bin/nyc
ADDED
package/nyc.config.cjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const getPluginsArraySync = require('@jcoreio/toolchain/util/getPluginsArraySync.cjs')
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
include: ['src/**'],
|
|
5
|
+
extension: getPluginsArraySync('sourceExtensions').map((ext) => '.' + ext),
|
|
6
|
+
reporter: ['lcov', 'text'],
|
|
7
|
+
sourceMap: true,
|
|
8
|
+
instrument: true,
|
|
9
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jcoreio/toolchain-mocha",
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"description": "Mocha build toolchain",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/jcoreio/toolchains.git",
|
|
8
|
+
"directory": "packages/mocha"
|
|
9
|
+
},
|
|
10
|
+
"author": "Andy Edwards",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/jcoreio/toolchains/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/jcoreio/toolchains/tree/beta/packages/mocha",
|
|
16
|
+
"bin": {
|
|
17
|
+
"mocha": "./bin/mocha",
|
|
18
|
+
"nyc": "./bin/nyc"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"dedent-js": "^1.0.1",
|
|
22
|
+
"mocha": "^9.1.3",
|
|
23
|
+
"nyc": "^15.1.0",
|
|
24
|
+
"resolve-bin": "^1.0.0"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"mocha": "^9.1.3",
|
|
28
|
+
"@jcoreio/toolchain": "1.0.0-beta.1"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { name } = require('../package.json')
|
|
2
|
+
const dedent = require('dedent-js')
|
|
3
|
+
|
|
4
|
+
module.exports = [
|
|
5
|
+
async function getConfigFiles() {
|
|
6
|
+
const files = {}
|
|
7
|
+
for (const file of ['.mocharc.cjs', 'nyc.config.cjs']) {
|
|
8
|
+
files[file] = dedent`
|
|
9
|
+
/* eslint-env node, es2018 */
|
|
10
|
+
const base = require('${name}/${file}')
|
|
11
|
+
module.exports = {
|
|
12
|
+
...base,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
`
|
|
16
|
+
}
|
|
17
|
+
return files
|
|
18
|
+
},
|
|
19
|
+
]
|
package/plugins/test.cjs
ADDED