Skip to content

Commit 3f9d4ef

Browse files
test: fix
1 parent efaa9a5 commit 3f9d4ef

1 file changed

Lines changed: 20 additions & 23 deletions

File tree

test/build/config-format/typescript-cjs/typescript.test.mjs

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -76,29 +76,26 @@ describe("typescript commonjs configuration", () => {
7676
expect(existsSync(resolve(__dirname, "dist/foo.bundle.js"))).toBeTruthy();
7777
});
7878

79-
it("should support typescript commonjs configuration (using `interpret`)", async () => {
80-
const [major] = process.versions.node.split(".").map(Number);
81-
const { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.ts"], {
82-
nodeOptions: [
83-
// Disable typescript strip types for tests
84-
...(major >= 22
85-
? [
86-
"--no-experimental-strip-types",
87-
// avoid problems with nyc
88-
"--import=ts-node/register",
89-
]
90-
: [
91-
// avoid problems with nyc
92-
"--import=ts-node/register",
93-
]),
94-
],
95-
});
79+
const [major] = process.versions.node.split(".").map(Number);
9680

97-
console.log(stdout);
81+
// Due to problems with nyc
82+
(major >= 22 ? it : it.skip)(
83+
"should support typescript commonjs configuration (using `interpret`)",
84+
async () => {
85+
const { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.ts"], {
86+
nodeOptions: [
87+
"--no-experimental-strip-types",
88+
// avoid problems with nyc
89+
"--import=ts-node/register",
90+
],
91+
});
9892

99-
expect(stderr).toBeFalsy();
100-
expect(stdout).toBeTruthy();
101-
expect(exitCode).toBe(0);
102-
expect(existsSync(resolve(__dirname, "dist/foo.bundle.js"))).toBeTruthy();
103-
});
93+
/* eslint-disable jest/no-standalone-expect */
94+
expect(stderr).toBeFalsy();
95+
expect(stdout).toBeTruthy();
96+
expect(exitCode).toBe(0);
97+
expect(existsSync(resolve(__dirname, "dist/foo.bundle.js"))).toBeTruthy();
98+
/* eslint-enable jest/no-standalone-expect */
99+
},
100+
);
104101
});

0 commit comments

Comments
 (0)