Skip to content
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

fix(remix): typo in tsconfig.spec.json update led to invalid tsconfig #21886

Merged
merged 1 commit into from Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -405,6 +405,39 @@ installGlobals();
"
`;

exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided --unitTestRunner should generate the correct files for testing using vitest 4`] = `
"{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../dist/out-tsc",
"types": [
"vitest/globals",
"vitest/importMeta",
"vite/client",
"node",
"vitest"
]
},
"include": [
"vite.config.ts",
"vitest.config.ts",
"app/**/*.ts",
"app/**/*.tsx",
"app/**/*.js",
"app/**/*.jsx",
"tests/**/*.spec.ts",
"tests/**/*.test.ts",
"tests/**/*.spec.tsx",
"tests/**/*.test.tsx",
"tests/**/*.spec.js",
"tests/**/*.test.js",
"tests/**/*.spec.jsx",
"tests/**/*.test.jsx"
]
}
"
`;

exports[`Remix Application Integrated Repo --projectNameAndRootFormat=as-provided should create the application correctly 1`] = `
"import { createWatchPaths } from '@nx/remix';
import { dirname } from 'path';
Expand Down Expand Up @@ -882,6 +915,39 @@ installGlobals();
"
`;

exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived --unitTestRunner should generate the correct files for testing using vitest 4`] = `
"{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": [
"vitest/globals",
"vitest/importMeta",
"vite/client",
"node",
"vitest"
]
},
"include": [
"vite.config.ts",
"vitest.config.ts",
"app/**/*.ts",
"app/**/*.tsx",
"app/**/*.js",
"app/**/*.jsx",
"tests/**/*.spec.ts",
"tests/**/*.test.ts",
"tests/**/*.spec.tsx",
"tests/**/*.test.tsx",
"tests/**/*.spec.js",
"tests/**/*.test.js",
"tests/**/*.spec.jsx",
"tests/**/*.test.jsx"
]
}
"
`;

exports[`Remix Application Integrated Repo --projectNameAndRootFormat=derived should create the application correctly 1`] = `
"import { createWatchPaths } from '@nx/remix';
import { dirname } from 'path';
Expand Down Expand Up @@ -1181,6 +1247,39 @@ test('renders loader data', async () => {
`;

exports[`Remix Application Standalone Project Repo --unitTestRunner should generate the correct files for testing using vitest 4`] = `
"{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/out-tsc",
"types": [
"vitest/globals",
"vitest/importMeta",
"vite/client",
"node",
"vitest"
]
},
"include": [
"vite.config.ts",
"vitest.config.ts",
"app/**/*.ts",
"app/**/*.tsx",
"app/**/*.js",
"app/**/*.jsx",
"tests/**/*.spec.ts",
"tests/**/*.test.ts",
"tests/**/*.spec.tsx",
"tests/**/*.test.tsx",
"tests/**/*.spec.js",
"tests/**/*.test.js",
"tests/**/*.spec.jsx",
"tests/**/*.test.jsx"
]
}
"
`;

exports[`Remix Application Standalone Project Repo --unitTestRunner should generate the correct files for testing using vitest 5`] = `
"import { installGlobals } from '@remix-run/node';
import '@testing-library/jest-dom/matchers';
installGlobals();
Expand Down
Expand Up @@ -74,6 +74,7 @@ describe('Remix Application', () => {
expect(
tree.read('tests/routes/_index.spec.tsx', 'utf-8')
).toMatchSnapshot();
expect(tree.read('tsconfig.spec.json', 'utf-8')).toMatchSnapshot();
expect(tree.read('test-setup.ts', 'utf-8')).toMatchSnapshot();
});

Expand Down Expand Up @@ -282,6 +283,9 @@ describe('Remix Application', () => {
expect(
tree.read(`${appDir}/test-setup.ts`, 'utf-8')
).toMatchSnapshot();
expect(
tree.read(`${appDir}/tsconfig.spec.json`, 'utf-8')
).toMatchSnapshot();
});

it('should generate the correct files for testing using jest', async () => {
Expand Down
Expand Up @@ -64,7 +64,7 @@ export function updateUnitTestConfig(
);

updateJson(tree, pathToTsConfigSpec, (json) => {
json.includes = [
json.include = [
'vite.config.ts',
'vitest.config.ts',
'app/**/*.ts',
Expand Down