mocha 11.1.0 → 11.2.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/bin/mocha.js +2 -2
- package/lib/cli/cli.js +7 -9
- package/lib/cli/collect-files.js +5 -5
- package/lib/cli/config.js +2 -2
- package/lib/cli/init.js +2 -2
- package/lib/cli/lookup-files.js +2 -2
- package/lib/cli/options.js +3 -3
- package/lib/cli/run-helpers.js +5 -5
- package/lib/cli/run.js +2 -2
- package/lib/cli/watch-run.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/mocha.js +1 -1
- package/lib/nodejs/esm-utils.js +2 -2
- package/lib/reporters/json.js +2 -2
- package/lib/reporters/tap.js +1 -1
- package/lib/reporters/xunit.js +13 -5
- package/lib/runnable.js +3 -1
- package/lib/runner.js +41 -3
- package/lib/suite.js +1 -1
- package/lib/utils.js +2 -2
- package/mocha.js +55 -7
- package/mocha.js.map +1 -1
- package/package.json +4 -3
package/bin/mocha.js
CHANGED
|
@@ -78,7 +78,7 @@ if (mochaArgs._) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (mochaArgs['node-option'] || Object.keys(nodeArgs).length || hasInspect) {
|
|
81
|
-
const {spawn} = require('child_process');
|
|
81
|
+
const {spawn} = require('node:child_process');
|
|
82
82
|
const mochaPath = require.resolve('../lib/cli/cli.js');
|
|
83
83
|
|
|
84
84
|
const nodeArgv =
|
|
@@ -126,7 +126,7 @@ if (mochaArgs['node-option'] || Object.keys(nodeArgs).length || hasInspect) {
|
|
|
126
126
|
// be needed.
|
|
127
127
|
if (!args.parallel || args.jobs < 2) {
|
|
128
128
|
// win32 does not support SIGTERM, so use next best thing.
|
|
129
|
-
if (require('os').platform() === 'win32') {
|
|
129
|
+
if (require('node:os').platform() === 'win32') {
|
|
130
130
|
proc.kill('SIGKILL');
|
|
131
131
|
} else {
|
|
132
132
|
// using SIGKILL won't cleanly close the output streams, which can result
|
package/lib/cli/cli.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
1
|
'use strict';
|
|
4
2
|
|
|
5
3
|
/**
|
|
@@ -13,7 +11,7 @@
|
|
|
13
11
|
const debug = require('debug')('mocha:cli:cli');
|
|
14
12
|
const symbols = require('log-symbols');
|
|
15
13
|
const yargs = require('yargs');
|
|
16
|
-
const path = require('path');
|
|
14
|
+
const path = require('node:path');
|
|
17
15
|
const {
|
|
18
16
|
loadRc,
|
|
19
17
|
loadPkgRc,
|
|
@@ -22,7 +20,7 @@ const {
|
|
|
22
20
|
} = require('./options');
|
|
23
21
|
const lookupFiles = require('./lookup-files');
|
|
24
22
|
const commands = require('./commands');
|
|
25
|
-
const
|
|
23
|
+
const pc = require('picocolors');
|
|
26
24
|
const {repository, homepage, version, discord} = require('../../package.json');
|
|
27
25
|
const {cwd} = require('../utils');
|
|
28
26
|
|
|
@@ -62,7 +60,7 @@ exports.main = (argv = process.argv.slice(2), mochaArgs) => {
|
|
|
62
60
|
.fail((msg, err, yargs) => {
|
|
63
61
|
debug('caught error sometime before command handler: %O', err);
|
|
64
62
|
yargs.showHelp();
|
|
65
|
-
console.error(`\n${symbols.error} ${
|
|
63
|
+
console.error(`\n${symbols.error} ${pc.red('ERROR:')} ${msg}`);
|
|
66
64
|
process.exit(1);
|
|
67
65
|
})
|
|
68
66
|
.help('help', 'Show usage information & exit')
|
|
@@ -71,10 +69,10 @@ exports.main = (argv = process.argv.slice(2), mochaArgs) => {
|
|
|
71
69
|
.alias('version', 'V')
|
|
72
70
|
.wrap(process.stdout.columns ? Math.min(process.stdout.columns, 80) : 80)
|
|
73
71
|
.epilog(
|
|
74
|
-
`${
|
|
75
|
-
Chat: ${
|
|
76
|
-
GitHub: ${
|
|
77
|
-
Docs: ${
|
|
72
|
+
`${pc.reset("Mocha Resources")}
|
|
73
|
+
Chat: ${pc.magenta(discord)}
|
|
74
|
+
GitHub: ${pc.blue(repository.url)}
|
|
75
|
+
Docs: ${pc.yellow(homepage)}
|
|
78
76
|
`
|
|
79
77
|
)
|
|
80
78
|
.parserConfiguration(YARGS_PARSER_CONFIG)
|
package/lib/cli/collect-files.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const pc = require('picocolors');
|
|
6
6
|
const debug = require('debug')('mocha:cli:run:helpers');
|
|
7
7
|
const minimatch = require('minimatch');
|
|
8
8
|
const {NO_FILES_MATCH_PATTERN} = require('../errors').constants;
|
|
@@ -94,12 +94,12 @@ module.exports = ({
|
|
|
94
94
|
unmatchedSpecFiles[0].pattern
|
|
95
95
|
)}` // stringify to print escaped characters raw
|
|
96
96
|
: 'Error: No test files found';
|
|
97
|
-
console.error(
|
|
97
|
+
console.error(pc.red(noneFoundMsg));
|
|
98
98
|
process.exit(1);
|
|
99
99
|
} else {
|
|
100
100
|
// print messages as a warning
|
|
101
101
|
unmatchedSpecFiles.forEach(warning => {
|
|
102
|
-
console.warn(
|
|
102
|
+
console.warn(pc.yellow(`Warning: ${warning.message}`));
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
|
package/lib/cli/config.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const fs = require('fs');
|
|
11
|
-
const path = require('path');
|
|
10
|
+
const fs = require('node:fs');
|
|
11
|
+
const path = require('node:path');
|
|
12
12
|
const debug = require('debug')('mocha:cli:config');
|
|
13
13
|
const findUp = require('find-up');
|
|
14
14
|
const {createUnparsableFileError} = require('../errors');
|
package/lib/cli/init.js
CHANGED
package/lib/cli/lookup-files.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @private
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
var fs = require('fs');
|
|
9
|
-
var path = require('path');
|
|
8
|
+
var fs = require('node:fs');
|
|
9
|
+
var path = require('node:path');
|
|
10
10
|
var glob = require('glob');
|
|
11
11
|
var errors = require('../errors');
|
|
12
12
|
var createNoFilesMatchPatternError = errors.createNoFilesMatchPatternError;
|
package/lib/cli/options.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @private
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const fs = require('fs');
|
|
11
|
-
const
|
|
10
|
+
const fs = require('node:fs');
|
|
11
|
+
const pc = require('picocolors');
|
|
12
12
|
const yargsParser = require('yargs-parser');
|
|
13
13
|
const {
|
|
14
14
|
types,
|
|
@@ -180,7 +180,7 @@ const parse = (args = [], defaultValues = {}, ...configObjects) => {
|
|
|
180
180
|
boolean: types.boolean.concat(nodeArgs.map(pair => pair[0]))
|
|
181
181
|
});
|
|
182
182
|
if (result.error) {
|
|
183
|
-
console.error(
|
|
183
|
+
console.error(pc.red(`Error: ${result.error.message}`));
|
|
184
184
|
process.exit(1);
|
|
185
185
|
}
|
|
186
186
|
|
package/lib/cli/run-helpers.js
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
* @private
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const fs = require('fs');
|
|
11
|
-
const path = require('path');
|
|
12
|
-
const
|
|
10
|
+
const fs = require('node:fs');
|
|
11
|
+
const path = require('node:path');
|
|
12
|
+
const pc = require('picocolors');
|
|
13
13
|
const debug = require('debug')('mocha:cli:run:helpers');
|
|
14
14
|
const {watchRun, watchParallelRun} = require('./watch-run');
|
|
15
15
|
const collectFiles = require('./collect-files');
|
|
16
|
-
const {format} = require('util');
|
|
16
|
+
const {format} = require('node:util');
|
|
17
17
|
const {createInvalidLegacyPluginError} = require('../errors');
|
|
18
18
|
const {requireOrImport} = require('../nodejs/esm-utils');
|
|
19
19
|
const PluginLoader = require('../plugin-loader');
|
|
@@ -121,7 +121,7 @@ const handleUnmatchedFiles = (mocha, unmatchedFiles) => {
|
|
|
121
121
|
|
|
122
122
|
unmatchedFiles.forEach(({pattern, absolutePath}) => {
|
|
123
123
|
console.error(
|
|
124
|
-
|
|
124
|
+
pc.yellow(
|
|
125
125
|
`Warning: Cannot find any files matching pattern "${pattern}" at the absolute path "${absolutePath}"`
|
|
126
126
|
)
|
|
127
127
|
);
|
package/lib/cli/run.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
const symbols = require('log-symbols');
|
|
11
|
-
const
|
|
11
|
+
const pc = require('picocolors');
|
|
12
12
|
const Mocha = require('../mocha');
|
|
13
13
|
const {
|
|
14
14
|
createUnsupportedError,
|
|
@@ -357,7 +357,7 @@ exports.builder = yargs =>
|
|
|
357
357
|
Object.assign(argv, plugins);
|
|
358
358
|
} catch (err) {
|
|
359
359
|
// this could be a bad --require, bad reporter, ui, etc.
|
|
360
|
-
console.error(`\n${symbols.error} ${
|
|
360
|
+
console.error(`\n${symbols.error} ${pc.red('ERROR:')}`, err);
|
|
361
361
|
yargs.exit(1);
|
|
362
362
|
}
|
|
363
363
|
})
|
package/lib/cli/watch-run.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const logSymbols = require('log-symbols');
|
|
4
4
|
const debug = require('debug')('mocha:cli:watch');
|
|
5
|
-
const path = require('path');
|
|
5
|
+
const path = require('node:path');
|
|
6
6
|
const chokidar = require('chokidar');
|
|
7
7
|
const Context = require('../context');
|
|
8
8
|
const collectFiles = require('./collect-files');
|
package/lib/errors.js
CHANGED
package/lib/mocha.js
CHANGED
package/lib/nodejs/esm-utils.js
CHANGED
package/lib/reporters/json.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
var Base = require('./base');
|
|
10
|
-
var fs = require('fs');
|
|
11
|
-
var path = require('path');
|
|
10
|
+
var fs = require('node:fs');
|
|
11
|
+
var path = require('node:path');
|
|
12
12
|
const createUnsupportedError = require('../errors').createUnsupportedError;
|
|
13
13
|
const utils = require('../utils');
|
|
14
14
|
var constants = require('../runner').constants;
|
package/lib/reporters/tap.js
CHANGED
package/lib/reporters/xunit.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
var Base = require('./base');
|
|
10
10
|
var utils = require('../utils');
|
|
11
|
-
var fs = require('fs');
|
|
12
|
-
var path = require('path');
|
|
11
|
+
var fs = require('node:fs');
|
|
12
|
+
var path = require('node:path');
|
|
13
13
|
var errors = require('../errors');
|
|
14
14
|
var createUnsupportedError = errors.createUnsupportedError;
|
|
15
15
|
var constants = require('../runner').constants;
|
|
@@ -104,7 +104,7 @@ function XUnit(runner, options) {
|
|
|
104
104
|
);
|
|
105
105
|
|
|
106
106
|
tests.forEach(function (t) {
|
|
107
|
-
self.test(t);
|
|
107
|
+
self.test(t, options);
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
self.write('</testsuite>');
|
|
@@ -152,13 +152,13 @@ XUnit.prototype.write = function (line) {
|
|
|
152
152
|
*
|
|
153
153
|
* @param {Test} test
|
|
154
154
|
*/
|
|
155
|
-
XUnit.prototype.test = function (test) {
|
|
155
|
+
XUnit.prototype.test = function (test, options) {
|
|
156
156
|
Base.useColors = false;
|
|
157
157
|
|
|
158
158
|
var attrs = {
|
|
159
159
|
classname: test.parent.fullTitle(),
|
|
160
160
|
name: test.title,
|
|
161
|
-
file: test.file,
|
|
161
|
+
file: testFilePath(test.file, options),
|
|
162
162
|
time: test.duration / 1000 || 0
|
|
163
163
|
};
|
|
164
164
|
|
|
@@ -215,4 +215,12 @@ function tag(name, attrs, close, content) {
|
|
|
215
215
|
return tag;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
function testFilePath(filepath, options) {
|
|
219
|
+
if (options && options.reporterOptions && options.reporterOptions.showRelativePaths) {
|
|
220
|
+
return path.relative(process.cwd(), filepath);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return filepath;
|
|
224
|
+
}
|
|
225
|
+
|
|
218
226
|
XUnit.description = 'XUnit-compatible XML output';
|
package/lib/runnable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var EventEmitter = require('events').EventEmitter;
|
|
3
|
+
var EventEmitter = require('node:events').EventEmitter;
|
|
4
4
|
var Pending = require('./pending');
|
|
5
5
|
var debug = require('debug')('mocha:runnable');
|
|
6
6
|
var milliseconds = require('ms');
|
|
@@ -24,8 +24,10 @@ var MAX_TIMEOUT = Math.pow(2, 31) - 1;
|
|
|
24
24
|
|
|
25
25
|
module.exports = Runnable;
|
|
26
26
|
|
|
27
|
+
// "Additional properties" doc comment added for hosted docs (mochajs.org/api)
|
|
27
28
|
/**
|
|
28
29
|
* Initialize a new `Runnable` with the given `title` and callback `fn`.
|
|
30
|
+
* Additional properties, like `getFullTitle()` and `slow()`, can be viewed in the `Runnable` source.
|
|
29
31
|
*
|
|
30
32
|
* @class
|
|
31
33
|
* @extends external:EventEmitter
|
package/lib/runner.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Module dependencies.
|
|
5
5
|
* @private
|
|
6
6
|
*/
|
|
7
|
-
var EventEmitter = require('events').EventEmitter;
|
|
7
|
+
var EventEmitter = require('node:events').EventEmitter;
|
|
8
8
|
var Pending = require('./pending');
|
|
9
9
|
var utils = require('./utils');
|
|
10
10
|
var debug = require('debug')('mocha:runner');
|
|
@@ -47,7 +47,39 @@ var globals = [
|
|
|
47
47
|
|
|
48
48
|
var constants = utils.defineConstants(
|
|
49
49
|
/**
|
|
50
|
-
* {@link Runner}-related constants.
|
|
50
|
+
* {@link Runner}-related constants. Used by reporters. Each event emits the corresponding object, unless otherwise indicated.
|
|
51
|
+
* @example
|
|
52
|
+
* const Mocha = require('mocha');
|
|
53
|
+
* const Base = Mocha.reporters.Base;
|
|
54
|
+
* const {
|
|
55
|
+
* EVENT_HOOK_BEGIN,
|
|
56
|
+
* EVENT_TEST_PASS,
|
|
57
|
+
* EVENT_TEST_FAIL,
|
|
58
|
+
* EVENT_TEST_END
|
|
59
|
+
* } = Mocha.Runner.constants
|
|
60
|
+
*
|
|
61
|
+
* function MyReporter(runner, options) {
|
|
62
|
+
* Base.call(this, runner, options);
|
|
63
|
+
*
|
|
64
|
+
* runner.on(EVENT_HOOK_BEGIN, function(hook) {
|
|
65
|
+
* console.log('hook called: ', hook.title);
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* runner.on(EVENT_TEST_PASS, function(test) {
|
|
69
|
+
* console.log('pass: %s', test.fullTitle());
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* runner.on(EVENT_TEST_FAIL, function(test, err) {
|
|
73
|
+
* console.log('fail: %s -- error: %s', test.fullTitle(), err.message);
|
|
74
|
+
* });
|
|
75
|
+
*
|
|
76
|
+
* runner.on(EVENT_TEST_END, function() {
|
|
77
|
+
* console.log('end: %d/%d', runner.stats.passes, runner.stats.tests);
|
|
78
|
+
* });
|
|
79
|
+
* }
|
|
80
|
+
*
|
|
81
|
+
* module.exports = MyReporter;
|
|
82
|
+
*
|
|
51
83
|
* @public
|
|
52
84
|
* @memberof Runner
|
|
53
85
|
* @readonly
|
|
@@ -97,7 +129,13 @@ var constants = utils.defineConstants(
|
|
|
97
129
|
*/
|
|
98
130
|
EVENT_TEST_END: 'test end',
|
|
99
131
|
/**
|
|
100
|
-
* Emitted when {@link Test} execution fails
|
|
132
|
+
* Emitted when {@link Test} execution fails. Includes an `err` object of type `Error`.
|
|
133
|
+
* @example
|
|
134
|
+
* runner.on(EVENT_TEST_FAIL, function(test, err) {
|
|
135
|
+
* console.log('fail: %s -- error: %s', test.fullTitle(), err.message);
|
|
136
|
+
* });
|
|
137
|
+
*
|
|
138
|
+
*
|
|
101
139
|
*/
|
|
102
140
|
EVENT_TEST_FAIL: 'fail',
|
|
103
141
|
/**
|
package/lib/suite.js
CHANGED
package/lib/utils.js
CHANGED
package/mocha.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// mocha@11.1
|
|
1
|
+
// mocha@11.2.1 in javascript ES2018
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -12980,8 +12980,10 @@
|
|
|
12980
12980
|
|
|
12981
12981
|
var runnable = Runnable$3;
|
|
12982
12982
|
|
|
12983
|
+
// "Additional properties" doc comment added for hosted docs (mochajs.org/api)
|
|
12983
12984
|
/**
|
|
12984
12985
|
* Initialize a new `Runnable` with the given `title` and callback `fn`.
|
|
12986
|
+
* Additional properties, like `getFullTitle()` and `slow()`, can be viewed in the `Runnable` source.
|
|
12985
12987
|
*
|
|
12986
12988
|
* @class
|
|
12987
12989
|
* @extends external:EventEmitter
|
|
@@ -14234,7 +14236,39 @@
|
|
|
14234
14236
|
|
|
14235
14237
|
var constants$1 = utils$1.defineConstants(
|
|
14236
14238
|
/**
|
|
14237
|
-
* {@link Runner}-related constants.
|
|
14239
|
+
* {@link Runner}-related constants. Used by reporters. Each event emits the corresponding object, unless otherwise indicated.
|
|
14240
|
+
* @example
|
|
14241
|
+
* const Mocha = require('mocha');
|
|
14242
|
+
* const Base = Mocha.reporters.Base;
|
|
14243
|
+
* const {
|
|
14244
|
+
* EVENT_HOOK_BEGIN,
|
|
14245
|
+
* EVENT_TEST_PASS,
|
|
14246
|
+
* EVENT_TEST_FAIL,
|
|
14247
|
+
* EVENT_TEST_END
|
|
14248
|
+
* } = Mocha.Runner.constants
|
|
14249
|
+
*
|
|
14250
|
+
* function MyReporter(runner, options) {
|
|
14251
|
+
* Base.call(this, runner, options);
|
|
14252
|
+
*
|
|
14253
|
+
* runner.on(EVENT_HOOK_BEGIN, function(hook) {
|
|
14254
|
+
* console.log('hook called: ', hook.title);
|
|
14255
|
+
* });
|
|
14256
|
+
*
|
|
14257
|
+
* runner.on(EVENT_TEST_PASS, function(test) {
|
|
14258
|
+
* console.log('pass: %s', test.fullTitle());
|
|
14259
|
+
* });
|
|
14260
|
+
*
|
|
14261
|
+
* runner.on(EVENT_TEST_FAIL, function(test, err) {
|
|
14262
|
+
* console.log('fail: %s -- error: %s', test.fullTitle(), err.message);
|
|
14263
|
+
* });
|
|
14264
|
+
*
|
|
14265
|
+
* runner.on(EVENT_TEST_END, function() {
|
|
14266
|
+
* console.log('end: %d/%d', runner.stats.passes, runner.stats.tests);
|
|
14267
|
+
* });
|
|
14268
|
+
* }
|
|
14269
|
+
*
|
|
14270
|
+
* module.exports = MyReporter;
|
|
14271
|
+
*
|
|
14238
14272
|
* @public
|
|
14239
14273
|
* @memberof Runner
|
|
14240
14274
|
* @readonly
|
|
@@ -14284,7 +14318,13 @@
|
|
|
14284
14318
|
*/
|
|
14285
14319
|
EVENT_TEST_END: 'test end',
|
|
14286
14320
|
/**
|
|
14287
|
-
* Emitted when {@link Test} execution fails
|
|
14321
|
+
* Emitted when {@link Test} execution fails. Includes an `err` object of type `Error`.
|
|
14322
|
+
* @example
|
|
14323
|
+
* runner.on(EVENT_TEST_FAIL, function(test, err) {
|
|
14324
|
+
* console.log('fail: %s -- error: %s', test.fullTitle(), err.message);
|
|
14325
|
+
* });
|
|
14326
|
+
*
|
|
14327
|
+
*
|
|
14288
14328
|
*/
|
|
14289
14329
|
EVENT_TEST_FAIL: 'fail',
|
|
14290
14330
|
/**
|
|
@@ -17745,7 +17785,7 @@
|
|
|
17745
17785
|
);
|
|
17746
17786
|
|
|
17747
17787
|
tests.forEach(function (t) {
|
|
17748
|
-
self.test(t);
|
|
17788
|
+
self.test(t, options);
|
|
17749
17789
|
});
|
|
17750
17790
|
|
|
17751
17791
|
self.write('</testsuite>');
|
|
@@ -17793,13 +17833,13 @@
|
|
|
17793
17833
|
*
|
|
17794
17834
|
* @param {Test} test
|
|
17795
17835
|
*/
|
|
17796
|
-
XUnit.prototype.test = function (test) {
|
|
17836
|
+
XUnit.prototype.test = function (test, options) {
|
|
17797
17837
|
Base.useColors = false;
|
|
17798
17838
|
|
|
17799
17839
|
var attrs = {
|
|
17800
17840
|
classname: test.parent.fullTitle(),
|
|
17801
17841
|
name: test.title,
|
|
17802
|
-
file: test.file,
|
|
17842
|
+
file: testFilePath(test.file, options),
|
|
17803
17843
|
time: test.duration / 1000 || 0
|
|
17804
17844
|
};
|
|
17805
17845
|
|
|
@@ -17856,6 +17896,14 @@
|
|
|
17856
17896
|
return tag;
|
|
17857
17897
|
}
|
|
17858
17898
|
|
|
17899
|
+
function testFilePath(filepath, options) {
|
|
17900
|
+
if (options && options.reporterOptions && options.reporterOptions.showRelativePaths) {
|
|
17901
|
+
return path.relative(process.cwd(), filepath);
|
|
17902
|
+
}
|
|
17903
|
+
|
|
17904
|
+
return filepath;
|
|
17905
|
+
}
|
|
17906
|
+
|
|
17859
17907
|
XUnit.description = 'XUnit-compatible XML output';
|
|
17860
17908
|
}(xunit));
|
|
17861
17909
|
|
|
@@ -19208,7 +19256,7 @@
|
|
|
19208
19256
|
};
|
|
19209
19257
|
|
|
19210
19258
|
var name = "mocha";
|
|
19211
|
-
var version = "11.1
|
|
19259
|
+
var version = "11.2.1";
|
|
19212
19260
|
var homepage = "https://mochajs.org/";
|
|
19213
19261
|
var notifyLogo = "https://ibin.co/4QuRuGjXvl36.png";
|
|
19214
19262
|
var require$$17 = {
|