Skip to content

Commit 253d161

Browse files
committed
Merge branch 'master' into repo/default-list-style
2 parents 798d5a6 + a5b5652 commit 253d161

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

docs/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,10 +2259,11 @@ Some shells support recursive matching by using the globstar (`**`) wildcard. Ba
22592259
$ mocha "./spec/**/*.js"
22602260
```
22612261

2262-
[You should _always_ quote your globs in npm scripts][article-globbing]. If you
2263-
use double quotes, it's the shell on UNIX that will expand the glob. On the
2264-
other hand, if you use single quotes, the [`node-glob`][npm-glob] module will
2265-
handle its expansion.
2262+
You should _always_ quote your globs in npm scripts. If you
2263+
use quotes, the [`node-glob`][npm-glob] module will
2264+
handle its expansion. For maximum compatibility,
2265+
surround the entire expression with double quotes and refrain
2266+
from `$`, `"`, `^`, and `\` within your expression.
22662267

22672268
See this [tutorial][gist-globbing-tutorial] on using globs.
22682269

@@ -2354,7 +2355,6 @@ For a running example of Mocha, view [example/tests.html](example/tests.html). F
23542355
or the [source](https://github.com/mochajs/mocha/blob/master/lib/mocha.js).
23552356

23562357
[//]: # 'Cross reference section'
2357-
[article-globbing]: https://medium.com/@jakubsynowiec/you-should-always-quote-your-globs-in-npm-scripts-621887a2a784
23582358
[bash-globbing]: https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html
23592359
[better-assert]: https://github.com/visionmedia/better-assert
23602360
[caniuse-notifications]: https://caniuse.com/#feat=notifications

lib/reporters/xunit.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ XUnit.prototype.test = function (test) {
158158
var attrs = {
159159
classname: test.parent.fullTitle(),
160160
name: test.title,
161+
file: test.file,
161162
time: test.duration / 1000 || 0
162163
};
163164

test/reporters/xunit.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('XUnit reporter', function () {
3030
var expectedLine = 'some-line';
3131
var expectedClassName = 'fullTitle';
3232
var expectedTitle = 'some title';
33+
var expectedFile = 'testFile.spec.js';
3334
var expectedMessage = 'some message';
3435
var expectedDiff =
3536
'\n + expected - actual\n\n -foo\n +bar\n ';
@@ -325,6 +326,7 @@ describe('XUnit reporter', function () {
325326
var expectedTest = {
326327
state: STATE_FAILED,
327328
title: expectedTitle,
329+
file: expectedFile,
328330
parent: {
329331
fullTitle: function () {
330332
return expectedClassName;
@@ -347,6 +349,8 @@ describe('XUnit reporter', function () {
347349
expectedClassName +
348350
'" name="' +
349351
expectedTitle +
352+
'" file="' +
353+
expectedFile +
350354
'" time="1"><failure>' +
351355
expectedMessage +
352356
'\n' +
@@ -365,6 +369,7 @@ describe('XUnit reporter', function () {
365369
var expectedTest = {
366370
state: STATE_FAILED,
367371
title: expectedTitle,
372+
file: expectedFile,
368373
parent: {
369374
fullTitle: function () {
370375
return expectedClassName;
@@ -402,6 +407,7 @@ describe('XUnit reporter', function () {
402407
return true;
403408
},
404409
title: expectedTitle,
410+
file: expectedFile,
405411
parent: {
406412
fullTitle: function () {
407413
return expectedClassName;
@@ -418,6 +424,8 @@ describe('XUnit reporter', function () {
418424
expectedClassName +
419425
'" name="' +
420426
expectedTitle +
427+
'" file="' +
428+
expectedFile +
421429
'" time="1"><skipped/></testcase>';
422430
expect(expectedWrite, 'to be', expectedTag);
423431
});
@@ -431,6 +439,7 @@ describe('XUnit reporter', function () {
431439
return false;
432440
},
433441
title: expectedTitle,
442+
file: expectedFile,
434443
parent: {
435444
fullTitle: function () {
436445
return expectedClassName;
@@ -447,6 +456,8 @@ describe('XUnit reporter', function () {
447456
expectedClassName +
448457
'" name="' +
449458
expectedTitle +
459+
'" file="' +
460+
expectedFile +
450461
'" time="0"/>';
451462
expect(expectedWrite, 'to be', expectedTag);
452463
});

0 commit comments

Comments
 (0)