Skip to content

Commit

Permalink
fix(remix): typo in tsconfig.spec.json update led to invalid tsconfig (
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 committed Feb 20, 2024
1 parent 4a5b5f2 commit 246fd19
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 1 deletion.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 246fd19

Please sign in to comment.