Skip to content

Commit 67e5f09

Browse files
committed
Running unit tests with TypeScript 6.0
1 parent 533c6ea commit 67e5f09

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

gulpfile.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ task
198198
files: ['**/*.json'],
199199
jsonVersion: 'standard',
200200
},
201+
{
202+
files: ['tsconfig.json'],
203+
jsonVersion: 'standard',
204+
language: 'json/jsonc',
205+
languageOptions: { allowTrailingCommas: true },
206+
},
201207
);
202208
const stream =
203209
src

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
"typescript_5.6": "npm:typescript@5.6",
7171
"typescript_5.7": "npm:typescript@5.7",
7272
"typescript_5.8": "npm:typescript@5.8",
73-
"typescript_5.9": "npm:typescript@5.9"
73+
"typescript_5.9": "npm:typescript@5.9",
74+
"typescript_6.0": "npm:typescript@6.0"
7475
},
7576
"engines": {
7677
"node": ">=16.0.0"

test/spec/ts-defs.spec.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { dirname, join } from 'node:path';
88
import { fileURLToPath } from 'node:url';
99
import { getImportStatement, getTestCase, processTestCase } from '#eslint-plugin-tstest';
1010
import { glob } from 'glob';
11+
import ts from 'typescript';
1112

1213
function defineTests(typescriptPkgName)
1314
{
@@ -186,8 +187,8 @@ await
186187
const compilerOptions =
187188
(() =>
188189
{
189-
const require = createRequire(import.meta.url);
190-
const { compilerOptions } = require('../../tsconfig.json');
190+
const { config: { compilerOptions } } =
191+
ts.readConfigFile(join(__dirname, '..', '..', 'tsconfig.json'), ts.sys.readFile);
191192
return compilerOptions;
192193
}
193194
)();

tsconfig.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
"compilerOptions": {
33
"exactOptionalPropertyTypes": true,
44
"forceConsistentCasingInFileNames": true,
5-
"module": "Node16",
6-
"moduleResolution": "Node16",
5+
"module": "node16",
76
"noUncheckedSideEffectImports": true,
87
"strict": true,
9-
"target": "ES2020",
10-
"verbatimModuleSyntax": true
8+
"target": "es2020",
9+
"types": [],
1110
},
1211
"include": [
1312
"example",
1413
"lib",
15-
"test"
16-
]
14+
"test",
15+
],
1716
}

0 commit comments

Comments
 (0)