Skip to content

chore(tsconfig-utils): sync vitest config with latest setup #11239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/project-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
"@typescript-eslint/types": "^8.35.0",
"debug": "^4.3.4"
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.3",
"rimraf": "*",
"typescript": "*",
"vitest": "^3.1.3"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
Expand Down
6 changes: 6 additions & 0 deletions packages/tsconfig-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
"peerDependencies": {
"typescript": ">=4.8.4 <5.9.0"
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.3",
"rimraf": "*",
"typescript": "*",
"vitest": "^3.1.3"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import * as path from 'node:path';
import * as ts from 'typescript';

import { getParsedConfigFile } from '../../src/getParsedConfigFile';
import { getParsedConfigFile } from '../src/getParsedConfigFile.js';

const mockGetParsedCommandLineOfConfigFile = vi.fn();

Expand All @@ -22,9 +22,9 @@ describe(getParsedConfigFile, () => {
});

it('throws an error when tsserver.sys is undefined', () => {
expect(() =>
getParsedConfigFile({} as typeof ts, './tsconfig.json'),
).toThrow(
expect(() => {
getParsedConfigFile({} as typeof ts, './tsconfig.json');
}).toThrow(
'`getParsedConfigFile` is only supported in a Node-like environment.',
);
});
Expand Down Expand Up @@ -72,9 +72,9 @@ describe(getParsedConfigFile, () => {
},
] satisfies ts.Diagnostic[],
});
expect(() => getParsedConfigFile(mockTsserver, './tsconfig.json')).toThrow(
/.+ error TS1234: Oh no!/,
);
expect(() => {
getParsedConfigFile(mockTsserver, './tsconfig.json');
}).toThrow(/.+ error TS1234: Oh no!/);
});

it('throws a diagnostic error when getParsedCommandLineOfConfigFile throws an error', () => {
Expand All @@ -96,9 +96,9 @@ describe(getParsedConfigFile, () => {
} satisfies ts.Diagnostic);
},
);
expect(() => getParsedConfigFile(mockTsserver, './tsconfig.json')).toThrow(
/.+ error TS1234: Oh no!/,
);
expect(() => {
getParsedConfigFile(mockTsserver, './tsconfig.json');
}).toThrow(/.+ error TS1234: Oh no!/);
});

it('uses compiler options when parsing a config file succeeds', () => {
Expand Down
13 changes: 2 additions & 11 deletions packages/tsconfig-utils/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo",
"emitDeclarationOnly": false,
"types": ["node"]
},
"include": ["src/**/*.ts", "typings"],
"exclude": ["vitest.config.mts", "src/**/*.spec.ts", "src/**/*.test.ts"],
"extends": "../../tsconfig.build.json",
"compilerOptions": {},
"references": []
}
14 changes: 1 addition & 13 deletions packages/tsconfig-utils/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc/packages/tsconfig-utils",
"module": "NodeNext",
"resolveJsonModule": true,
"types": ["node", "vitest/globals", "vitest/importMeta"]
"outDir": "../../dist/packages/tsconfig-utils"
},
"include": [
"vitest.config.mts",
"package.json",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.d.ts",
"tests"
],
"exclude": ["**/fixtures/**"],
"references": [
{
"path": "./tsconfig.build.json"
Expand Down
5 changes: 0 additions & 5 deletions packages/tsconfig-utils/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@ const vitestConfig = mergeConfig(
root: import.meta.dirname,

test: {
diff: {
maxDepth: 1,
},

dir: path.join(import.meta.dirname, 'tests'),
name: packageJson.name.replace('@typescript-eslint/', ''),
root: import.meta.dirname,
testTimeout: 10_000,
},
}),
);
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy