Skip to content

Commit bc8ecba

Browse files
committed
fix: change path import
1 parent 07efef8 commit bc8ecba

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

test/__tests__/typedef-with-template-test.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,37 @@
11
import * as fs from "fs";
2-
import { posix as path } from "path";
32

43
import * as Utils from "../utils";
54

65
describe("Typedef with template", () => {
76
test("api.test.domain", () => {
8-
const generateCode = fs.readFileSync(path.resolve(__dirname, "../code/typedef-with-template/api.test.domain.ts"), { encoding: "utf-8" });
7+
const generateCode = fs.readFileSync("test/code/typedef-with-template/api.test.domain.ts", { encoding: "utf-8" });
98
const text = Utils.replaceVersionInfo(generateCode);
109
expect(text).toMatchSnapshot();
1110
});
1211
test("api.v2.domain", () => {
13-
const generateCode = fs.readFileSync(path.resolve(__dirname, "../code/typedef-with-template/api.v2.domain.ts"), { encoding: "utf-8" });
12+
const generateCode = fs.readFileSync("test/code/typedef-with-template/api.v2.domain.ts", { encoding: "utf-8" });
1413
const text = Utils.replaceVersionInfo(generateCode);
1514
expect(text).toMatchSnapshot();
1615
});
1716
test("async-api.test.domain", () => {
18-
const filepath = path.resolve(__dirname, "../code/typedef-with-template/sync-api.test.domain.ts");
19-
console.log({ filepath });
20-
const generateCode = fs.readFileSync(filepath, {
17+
const generateCode = fs.readFileSync("test/code/typedef-with-template/sync-api.test.domain.ts", {
2118
encoding: "utf-8",
2219
});
2320
const text = Utils.replaceVersionInfo(generateCode);
2421
expect(text).toMatchSnapshot();
2522
});
2623
test("infer.domain", () => {
27-
const generateCode = fs.readFileSync(path.resolve(__dirname, "../code/typedef-with-template/infer.domain.ts"), { encoding: "utf-8" });
24+
const generateCode = fs.readFileSync("test/code/typedef-with-template/infer.domain.ts", { encoding: "utf-8" });
2825
const text = Utils.replaceVersionInfo(generateCode);
2926
expect(text).toMatchSnapshot();
3027
});
3128
test("ref-access", () => {
32-
const generateCode = fs.readFileSync(path.resolve(__dirname, "../code/typedef-with-template/ref-access.ts"), { encoding: "utf-8" });
29+
const generateCode = fs.readFileSync("test/code/typedef-with-template/ref-access.ts", { encoding: "utf-8" });
3330
const text = Utils.replaceVersionInfo(generateCode);
3431
expect(text).toMatchSnapshot();
3532
});
3633
test("remote-ref-access", () => {
37-
const generateCode = fs.readFileSync(path.resolve(__dirname, "../code/typedef-with-template/remote-ref-access.ts"), { encoding: "utf-8" });
34+
const generateCode = fs.readFileSync("test/code/typedef-with-template/remote-ref-access.ts", { encoding: "utf-8" });
3835
const text = Utils.replaceVersionInfo(generateCode);
3936
expect(text).toMatchSnapshot();
4037
});

0 commit comments

Comments
 (0)