Comparing version 5.3.1 to 5.3.2
'use strict'; | ||
const { extname: extnamePath } = require('path'); | ||
const { pathToFileURL } = require('url'); | ||
const getPackageType = require('get-package-type'); | ||
@@ -11,5 +12,5 @@ | ||
if (ext === '.mjs' || (ext === '.js' && getPackageType.sync(file) === 'module')) { | ||
return import(file); | ||
return import(pathToFileURL(file).href); | ||
} | ||
require(file); | ||
}; |
{ | ||
"name": "tape", | ||
"version": "5.3.1", | ||
"version": "5.3.2", | ||
"description": "tap-producing test harness for node and browsers", | ||
"main": "index.js", | ||
"browser": { | ||
"fs": false | ||
}, | ||
"exports": { | ||
@@ -31,3 +34,3 @@ ".": [ | ||
"get-package-type": "^0.1.0", | ||
"glob": "^7.1.7", | ||
"glob": "^7.2.0", | ||
"has": "^1.0.3", | ||
@@ -43,8 +46,8 @@ "has-dynamic-import": "^2.0.0", | ||
"resumer": "^0.0.0", | ||
"string.prototype.trim": "^1.2.4", | ||
"string.prototype.trim": "^1.2.5", | ||
"through": "^2.3.8" | ||
}, | ||
"devDependencies": { | ||
"@ljharb/eslint-config": "^17.6.0", | ||
"array.prototype.flatmap": "^1.2.4", | ||
"@ljharb/eslint-config": "^19.0.1", | ||
"array.prototype.flatmap": "^1.2.5", | ||
"aud": "^1.1.5", | ||
@@ -55,6 +58,6 @@ "concat-stream": "^1.6.2", | ||
"es-value-fixtures": "^1.2.1", | ||
"eslint": "^7.32.0", | ||
"eslint": "^8.2.0", | ||
"falafel": "^2.2.4", | ||
"js-yaml": "^3.14.0", | ||
"safe-publish-latest": "^1.1.4", | ||
"safe-publish-latest": "^2.0.0", | ||
"tap": "^8.0.1", | ||
@@ -61,0 +64,0 @@ "tap-parser": "^3.0.5" |
@@ -15,2 +15,11 @@ 'use strict'; | ||
var node17 = Number(majorVersion) >= 17; | ||
var lengthMessage = 'Cannot read property \'length\' of null'; | ||
try { | ||
lengthMessage = null.length; | ||
} catch (e) { | ||
lengthMessage = e.message; // differs in v8 6.9+ (node 16.9+) | ||
} | ||
tap.test('async1', function (t) { | ||
@@ -198,3 +207,3 @@ runProgram('async-await', 'async1.js', function (r) { | ||
t.same(stripFullStack(stderr), [ | ||
t.same(stripFullStack(stderr), [].concat( | ||
'$TEST/async-await/sync-error.js:7', | ||
@@ -209,4 +218,8 @@ ' throw new Error(\'oopsie\');', | ||
' at Test.bound [as run] ($TAPE/lib/test.js:$LINE:$COL)', | ||
node17 ? [ | ||
'', | ||
'Node.js ' + process.version | ||
] : [], | ||
'' | ||
]); | ||
)); | ||
t.end(); | ||
@@ -273,7 +286,7 @@ }); | ||
'ok 2 should be strictly equal', | ||
'not ok 3 TypeError: Cannot read property \'length\' of null', | ||
'not ok 3 TypeError: ' + lengthMessage, | ||
' ---', | ||
' operator: error', | ||
' stack: |-', | ||
' TypeError: Cannot read property \'length\' of null', | ||
' TypeError: ' + lengthMessage, | ||
' at myCode ($TEST/async-await/async-bug.js:$LINE:$COL)', | ||
@@ -280,0 +293,0 @@ ' at Test.myTest ($TEST/async-await/async-bug.js:$LINE:$COL)', |
@@ -50,3 +50,3 @@ 'use strict'; | ||
var stripped = ' [... stack stripped ...]'; | ||
var withDuplicates = output.split('\n').map(stripChangingData).map(function (line) { | ||
var withDuplicates = output.split(/\r?\n/g).map(stripChangingData).map(function (line) { | ||
var m = line.match(/[ ]{8}at .*\((.*)\)/); | ||
@@ -79,5 +79,5 @@ | ||
// Handle stack trace variation in Node v0.8 | ||
/(\[\.\.\. stack stripped \.\.\.\]\n *at) <anonymous> \(([^)]+)\)/g, | ||
/(\[\.\.\. stack stripped \.\.\.\]\r?\n *at) <anonymous> \(([^)]+)\)/g, | ||
'$1 $2' | ||
).split('\n'); | ||
).split(/\r?\n/g); | ||
}; | ||
@@ -84,0 +84,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
248396
6492
552
Updatedglob@^7.2.0
Updatedstring.prototype.trim@^1.2.5