Skip to content

Commit

Permalink
fix windows test
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Aug 24, 2022
1 parent a75ea8b commit 8bdadb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions packages/babel-core/test/errors-stacks.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as babel from "../lib/index.js";

// TODO: Remove this in Babel 8, once we drop Node.js 8
import { URL } from "url";
import { fileURLToPath } from "url";
import path from "path";

const replaceAll = "".replaceAll
? Function.call.bind("".replaceAll)
Expand Down Expand Up @@ -69,7 +70,11 @@ function expectError(run) {
}

const fixture = name =>
new URL(`./fixtures/errors/${name}`, import.meta.url).pathname;
path.join(
path.dirname(fileURLToPath(import.meta.url)),
"fixtures/errors",
name,
);

describe("@babel/core errors", function () {
beforeAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/set-module-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { fileURLToPath } from "url";
import path from "path";

const root = rel =>
path.join(fileURLToPath(path.dirname(import.meta.url)), "../", rel);
path.join(path.dirname(fileURLToPath(import.meta.url)), "../", rel);

// prettier-ignore
let moduleType;
Expand Down

0 comments on commit 8bdadb3

Please sign in to comment.