Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew-Daniels committed Aug 4, 2024
1 parent 3f496d9 commit f49b397
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 87 deletions.
11 changes: 0 additions & 11 deletions apps/iframe-react-app/jest.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion apps/iframe-react-app/src/app/app.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ describe('App', () => {
<App />
</BrowserRouter>
);
expect(getByText(/Welcome iframe-react-app/gi)).toBeTruthy();
expect(getByText(/Logged out/gi)).toBeTruthy();
});
});
11 changes: 6 additions & 5 deletions apps/iframe-react-app/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": [
"jest",
"vitest/globals",
"vitest/importMeta",
"vite/client",
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
"vitest"
]
},
"include": [
"jest.config.ts",
"vite.config.ts",
"vitest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
Expand Down
13 changes: 12 additions & 1 deletion apps/iframe-react-app/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
/// <reference types='vitest' />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';

export default defineConfig({
test: {
watch: false,
globals: true,
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],

reporters: ['default'],
coverage: {
reportsDirectory: '../../coverage/apps/iframe-react-app',
provider: 'v8',
},
},
root: __dirname,
cacheDir: '../../node_modules/.vite/apps/iframe-react-app',

Expand Down
11 changes: 0 additions & 11 deletions apps/parent-react-app/jest.config.ts

This file was deleted.

4 changes: 2 additions & 2 deletions apps/parent-react-app/src/app/app.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('App', () => {
});

it('should have a greeting as the title', () => {
const { getByText } = render(<App />);
expect(getByText(/Welcome liaison/gi)).toBeTruthy();
const { getAllByText } = render(<App />);
expect(getAllByText(/demo/gi)).toBeTruthy();
});
});
11 changes: 6 additions & 5 deletions apps/parent-react-app/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": [
"jest",
"vitest/globals",
"vitest/importMeta",
"vite/client",
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
"vitest"
]
},
"include": [
"jest.config.ts",
"vite.config.ts",
"vitest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
Expand Down
13 changes: 12 additions & 1 deletion apps/parent-react-app/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
/// <reference types='vitest' />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';

export default defineConfig({
test: {
watch: false,
globals: true,
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],

reporters: ['default'],
coverage: {
reportsDirectory: '../../coverage/apps/parent-react-app',
provider: 'v8',
},
},
root: __dirname,
cacheDir: '../../node_modules/.vite/apps/liaison',

Expand Down
5 changes: 0 additions & 5 deletions jest.config.ts

This file was deleted.

17 changes: 0 additions & 17 deletions libs/constants/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,4 @@ export default defineConfig({
cacheDir: '../../node_modules/.vite/libs/constants',

plugins: [nxViteTsPaths()],

// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },

test: {
watch: false,
globals: true,
environment: 'node',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: {
reportsDirectory: '../../coverage/libs/constants',
provider: 'v8',
},
},
});
2 changes: 1 addition & 1 deletion libs/core/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineConfig({
test: {
watch: false,
globals: true,
environment: 'node',
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: { reportsDirectory: '../../coverage/libs/core', provider: 'v8' },
Expand Down
7 changes: 1 addition & 6 deletions libs/react/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types='vitest' />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
Expand Down Expand Up @@ -52,11 +51,7 @@ export default defineConfig({
globals: true,
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],

reporters: ['default'],
coverage: {
reportsDirectory: '../../coverage/libs/react',
provider: 'v8',
},
coverage: { reportsDirectory: '../../coverage/libs/react', provider: 'v8' },
},
});
14 changes: 0 additions & 14 deletions libs/types/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,4 @@ export default defineConfig({
cacheDir: '../../node_modules/.vite/libs/types',

plugins: [nxViteTsPaths()],

// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },

test: {
watch: false,
globals: true,
environment: 'node',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: { reportsDirectory: '../../coverage/libs/types', provider: 'v8' },
},
});
7 changes: 1 addition & 6 deletions libs/ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types='vitest' />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
Expand Down Expand Up @@ -52,11 +51,7 @@ export default defineConfig({
globals: true,
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],

reporters: ['default'],
coverage: {
reportsDirectory: '../../coverage/libs/ui',
provider: 'v8',
},
coverage: { reportsDirectory: '../../coverage/libs/ui', provider: 'v8' },
},
});
5 changes: 5 additions & 0 deletions libs/utils/src/lib/utils.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { timeout } from "./utils";

describe('timeout', () => {
it.todo('should work');
});
2 changes: 1 addition & 1 deletion libs/utils/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineConfig({
test: {
watch: false,
globals: true,
environment: 'node',
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: { reportsDirectory: '../../coverage/libs/utils', provider: 'v8' },
Expand Down

0 comments on commit f49b397

Please sign in to comment.