Skip to content

Commit 380e94e

Browse files
committed
test: fix failing tests
- Restore the `tsconfig.test.ts` snapshots: the file was committed empty after the tests were renamed in a2c0810, which only fails on CI where vitest does not write missing snapshots. - Drop the `experimentalDts` cases for `node10`/`node` module resolution, deprecated in TypeScript 6 and an error without `ignoreDeprecations`. - Give the vue + ts-essentials `--dts-resolve` test a bigger heap: resolving those types peaks at ~4.2GB, just above the default limit of the dts worker since the TypeScript 6 upgrade.
1 parent b601adf commit 380e94e

3 files changed

Lines changed: 52 additions & 4 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`support paths in tsconfig.json 1`] = `
4+
"var __defProp = Object.defineProperty;
5+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6+
var __getOwnPropNames = Object.getOwnPropertyNames;
7+
var __hasOwnProp = Object.prototype.hasOwnProperty;
8+
var __export = (target, all) => {
9+
for (var name in all)
10+
__defProp(target, name, { get: all[name], enumerable: true });
11+
};
12+
var __copyProps = (to, from, except, desc) => {
13+
if (from && typeof from === "object" || typeof from === "function") {
14+
for (let key of __getOwnPropNames(from))
15+
if (!__hasOwnProp.call(to, key) && key !== except)
16+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17+
}
18+
return to;
19+
};
20+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21+
22+
// input.ts
23+
var input_exports = {};
24+
__export(input_exports, {
25+
foo: () => foo
26+
});
27+
module.exports = __toCommonJS(input_exports);
28+
29+
// foo.ts
30+
var foo = "foo";
31+
// Annotate the CommonJS export names for ESM import in node:
32+
0 && (module.exports = {
33+
foo
34+
});
35+
"
36+
`;
37+
38+
exports[`support paths in tsconfig.json in --dts build 1`] = `
39+
"declare const foo = "foo";
40+
41+
export { foo };
42+
"
43+
`;
44+
45+
exports[`support paths in tsconfig.json in --dts-resolve build 1`] = `
46+
"declare const foo = "foo";
47+
48+
export { foo };
49+
"
50+
`;

‎test/example.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ test('bundle vue and ts-essentials with --dts --dts-resolve flag', async () => {
1111
},
1212
{
1313
flags: ['--dts', '--dts-resolve'],
14+
// resolving the types of these two needs more than the default heap
15+
env: { NODE_OPTIONS: '--max-old-space-size=8192' },
1416
},
1517
)
1618
})

‎test/experimental-dts.test.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ test.for([
77
{ moduleResolution: 'Node16', moduleKind: 'Node16' },
88
{ moduleResolution: 'Bundler', moduleKind: 'ESNext' },
99
{ moduleResolution: 'Bundler', moduleKind: 'Preserve' },
10-
{ moduleResolution: 'Node10', moduleKind: 'ESNext' },
11-
{ moduleResolution: 'Node10', moduleKind: 'CommonJS' },
12-
{ moduleResolution: 'Node', moduleKind: 'ESNext' },
13-
{ moduleResolution: 'Node', moduleKind: 'CommonJS' },
1410
] as const)(
1511
"experimentalDts works with TypeScript's $moduleResolution module resolution and module set to $moduleKind",
1612
async ({ moduleResolution, moduleKind }, { expect, task }) => {

0 commit comments

Comments
 (0)