|
1 | 1 | import * as fs from "fs";
|
2 |
| -import * as path from "path"; |
3 | 2 |
|
4 | 3 | import * as Utils from "../utils";
|
5 | 4 |
|
6 | 5 | describe("Typedef with template", () => {
|
7 | 6 | test("api.test.domain", () => {
|
8 |
| - const generateCode = fs.readFileSync(path.join(__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" }); |
9 | 8 | const text = Utils.replaceVersionInfo(generateCode);
|
10 | 9 | expect(text).toMatchSnapshot();
|
11 | 10 | });
|
12 | 11 | test("api.v2.domain", () => {
|
13 |
| - const generateCode = fs.readFileSync(path.join(__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" }); |
14 | 13 | const text = Utils.replaceVersionInfo(generateCode);
|
15 | 14 | expect(text).toMatchSnapshot();
|
16 | 15 | });
|
17 | 16 | test("async-api.test.domain", () => {
|
18 |
| - const generateCode = fs.readFileSync(path.join(__dirname, "../code/typedef-with-template/sync-api.test.domain.ts"), { encoding: "utf-8" }); |
| 17 | + const generateCode = fs.readFileSync("test/code/typedef-with-template/sync-api.test.domain.ts", { |
| 18 | + encoding: "utf-8", |
| 19 | + }); |
19 | 20 | const text = Utils.replaceVersionInfo(generateCode);
|
20 | 21 | expect(text).toMatchSnapshot();
|
21 | 22 | });
|
22 | 23 | test("infer.domain", () => {
|
23 |
| - const generateCode = fs.readFileSync(path.join(__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" }); |
24 | 25 | const text = Utils.replaceVersionInfo(generateCode);
|
25 | 26 | expect(text).toMatchSnapshot();
|
26 | 27 | });
|
27 | 28 | test("ref-access", () => {
|
28 |
| - const generateCode = fs.readFileSync(path.join(__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" }); |
29 | 30 | const text = Utils.replaceVersionInfo(generateCode);
|
30 | 31 | expect(text).toMatchSnapshot();
|
31 | 32 | });
|
32 | 33 | test("remote-ref-access", () => {
|
33 |
| - const generateCode = fs.readFileSync(path.join(__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" }); |
34 | 35 | const text = Utils.replaceVersionInfo(generateCode);
|
35 | 36 | expect(text).toMatchSnapshot();
|
36 | 37 | });
|
|
0 commit comments