node-tdd 3.3.1 → 3.3.2
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/lib/util/desc.js +9 -1
- package/package.json +1 -1
package/lib/util/desc.js
CHANGED
|
@@ -10,6 +10,10 @@ const callsites = require('callsites');
|
|
|
10
10
|
|
|
11
11
|
const get = require('lodash.get');
|
|
12
12
|
|
|
13
|
+
const {
|
|
14
|
+
fileURLToPath
|
|
15
|
+
} = require('url');
|
|
16
|
+
|
|
13
17
|
const minimist = require('minimist');
|
|
14
18
|
|
|
15
19
|
const tmp = require('tmp');
|
|
@@ -45,7 +49,11 @@ const mocha = {
|
|
|
45
49
|
const desc = (suiteName, optsOrTests, testsOrNull = null) => {
|
|
46
50
|
const opts = testsOrNull === null ? {} : optsOrTests;
|
|
47
51
|
const tests = testsOrNull === null ? optsOrTests : testsOrNull;
|
|
48
|
-
const
|
|
52
|
+
const filenameOrUrl = callsites()[1].getFileName(); // eslint-disable-next-line @blackflux/rules/istanbul-prevent-ignore
|
|
53
|
+
|
|
54
|
+
/* istanbul ignore next */
|
|
55
|
+
|
|
56
|
+
const testFile = path.resolve(filenameOrUrl.startsWith('file://') ? fileURLToPath(filenameOrUrl) : filenameOrUrl);
|
|
49
57
|
|
|
50
58
|
const resolve = name => path.join(path.dirname(testFile), name.replace(/\$FILENAME/g, path.basename(testFile)));
|
|
51
59
|
|