diff --git a/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap b/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap index 03ac40a598..9c79e5d0fb 100644 --- a/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap +++ b/packages/remix/src/generators/application/__snapshots__/application.impl.spec.ts.snap @@ -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'; @@ -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'; @@ -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(); diff --git a/packages/remix/src/generators/application/application.impl.spec.ts b/packages/remix/src/generators/application/application.impl.spec.ts index 6346c60a80..2fd13383e4 100644 --- a/packages/remix/src/generators/application/application.impl.spec.ts +++ b/packages/remix/src/generators/application/application.impl.spec.ts @@ -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(); }); @@ -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 () => { diff --git a/packages/remix/src/generators/application/lib/update-unit-test-config.ts b/packages/remix/src/generators/application/lib/update-unit-test-config.ts index 3af2a85a41..478c3b9414 100644 --- a/packages/remix/src/generators/application/lib/update-unit-test-config.ts +++ b/packages/remix/src/generators/application/lib/update-unit-test-config.ts @@ -64,7 +64,7 @@ export function updateUnitTestConfig( ); updateJson(tree, pathToTsConfigSpec, (json) => { - json.includes = [ + json.include = [ 'vite.config.ts', 'vitest.config.ts', 'app/**/*.ts',