@jcoreio/toolchain-mocha 3.6.1 → 3.6.3
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/nyc.config.cjs +3 -2
- package/package.json +4 -3
- package/plugins/babelPlugins.cjs +19 -0
- package/plugins/scripts.cjs +12 -2
package/nyc.config.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
const { toolchainPackages } = require('@jcoreio/toolchain/util/findUps.cjs')
|
|
1
2
|
const getPluginsArraySync = require('@jcoreio/toolchain/util/getPluginsArraySync.cjs')
|
|
2
3
|
|
|
3
4
|
module.exports = {
|
|
4
5
|
include: ['src/**'],
|
|
5
6
|
extension: getPluginsArraySync('sourceExtensions').map((ext) => '.' + ext),
|
|
6
7
|
reporter: ['lcov', 'text'],
|
|
7
|
-
sourceMap:
|
|
8
|
-
instrument:
|
|
8
|
+
sourceMap: !toolchainPackages.includes('@jcoreio/toolchain-esnext'),
|
|
9
|
+
instrument: !toolchainPackages.includes('@jcoreio/toolchain-esnext'),
|
|
9
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jcoreio/toolchain-mocha",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.3",
|
|
4
4
|
"description": "Mocha build toolchain",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,14 +19,15 @@
|
|
|
19
19
|
},
|
|
20
20
|
"main": "./index.cjs",
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"babel-plugin-istanbul": "^6.1.1",
|
|
22
23
|
"dedent-js": "^1.0.1",
|
|
23
24
|
"mocha": "^10.2.0",
|
|
24
25
|
"nyc": "^15.1.0",
|
|
25
26
|
"resolve-bin": "^1.0.0",
|
|
26
|
-
"@jcoreio/toolchain": "3.6.
|
|
27
|
+
"@jcoreio/toolchain": "3.6.3"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
|
-
"@jcoreio/toolchain": "3.6.
|
|
30
|
+
"@jcoreio/toolchain": "3.6.3"
|
|
30
31
|
},
|
|
31
32
|
"toolchainManaged": {
|
|
32
33
|
"devDependencies": {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
[
|
|
3
|
+
(api) => {
|
|
4
|
+
const { JCOREIO_TOOLCHAIN_COVERAGE } = process.env
|
|
5
|
+
api.cache.using(() => JCOREIO_TOOLCHAIN_COVERAGE)
|
|
6
|
+
return [
|
|
7
|
+
JCOREIO_TOOLCHAIN_COVERAGE && require.resolve('babel-plugin-istanbul'),
|
|
8
|
+
].filter(Boolean)
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
after: [
|
|
12
|
+
'@jcoreio/toolchain-esnext',
|
|
13
|
+
'@jcoreio/toolchain-flow',
|
|
14
|
+
'@jcoreio/toolchain-typescript',
|
|
15
|
+
'@jcoreio/toolchain-react',
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
]
|
package/plugins/scripts.cjs
CHANGED
|
@@ -12,7 +12,12 @@ module.exports = [
|
|
|
12
12
|
testScripts.length ? 'all tests' : 'tests'
|
|
13
13
|
} with code coverage`,
|
|
14
14
|
run: async (args = []) => {
|
|
15
|
-
await execa('nyc', ['tc', 'test', ...args]
|
|
15
|
+
await execa('nyc', ['tc', 'test', ...args], {
|
|
16
|
+
env: {
|
|
17
|
+
...process.env,
|
|
18
|
+
JCOREIO_TOOLCHAIN_COVERAGE: '1',
|
|
19
|
+
},
|
|
20
|
+
})
|
|
16
21
|
},
|
|
17
22
|
},
|
|
18
23
|
...Object.fromEntries(
|
|
@@ -25,7 +30,12 @@ module.exports = [
|
|
|
25
30
|
: `run ${name}`
|
|
26
31
|
} with code coverage`,
|
|
27
32
|
run: async (args = []) => {
|
|
28
|
-
await execa('nyc', ['tc', name, ...args]
|
|
33
|
+
await execa('nyc', ['tc', name, ...args], {
|
|
34
|
+
env: {
|
|
35
|
+
...process.env,
|
|
36
|
+
JCOREIO_TOOLCHAIN_COVERAGE: '1',
|
|
37
|
+
},
|
|
38
|
+
})
|
|
29
39
|
},
|
|
30
40
|
},
|
|
31
41
|
])
|