Skip to content

Commit

Permalink
fix: ./ for registry loading, even on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed May 15, 2023
1 parent 362f6c5 commit 70d4c1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/wrap-loader.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ wrapLoader.pitch = function pitch (remainingRequest) {

// wrap the test in a function that is only called when we want it called
return `
import { registry } from ${JSON.stringify(`.${path.sep}${path.relative(process.cwd(), path.resolve(argv.outputDir, 'test-registry.js'))}`)}
import { registry } from ${JSON.stringify(`./${path.relative(process.cwd(), path.resolve(argv.outputDir, 'test-registry.js'))}`)}
registry.argv = JSON.parse(${JSON.stringify(JSON.stringify(argv))})
registry.tests.push({
name: JSON.parse('${JSON.stringify(path.normalize(path.relative(process.cwd(), remainingRequest))).replace(/\\/g, '/')}'),
Expand Down
3 changes: 3 additions & 0 deletions test/test-bare-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ testing bare fixture
stdout = stdout.replace(/^ +at .*\n/gm, '') // stack traces
const expected = expectedTemplate.replace(/WORKER/, 'not in worker')
let found = stdout.indexOf(expected)
if (found === -1) {
console.error(stdout)
}
assert.ok(found > -1, 'stdout contains expected test output')
found = stdout.indexOf(expected, found + 1)
assert.ok(found === -1, 'stdout doesn\'t contain second instance of expected test output')
Expand Down

0 comments on commit 70d4c1f

Please sign in to comment.