diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98c534eb..7c64626f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,4 +38,4 @@ jobs: - name: Test id: npm-test - run: npm run test + run: npm run unit:tests diff --git a/apps/api/src/app/init-server.ts b/apps/api/src/app/init-server.ts index 3ef62693..eafde320 100644 --- a/apps/api/src/app/init-server.ts +++ b/apps/api/src/app/init-server.ts @@ -63,6 +63,7 @@ fastify.register(async function (fastify) { }); fastify.get('/sub', { websocket: true }, async (connection, req) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const cookies = (req as any).cookies; const sessionId = cookies[lucia.sessionCookieName]; diff --git a/apps/api/src/tests/ws-leave.spec.ts b/apps/api/src/tests/ws-leave.spec.ts index 22cdaa6d..0e6eede5 100644 --- a/apps/api/src/tests/ws-leave.spec.ts +++ b/apps/api/src/tests/ws-leave.spec.ts @@ -28,7 +28,6 @@ describe('ws', () => { beforeAll(async () => { await startDB(); - console.log('fin start db'); await createMultipleUsers(); wsServer = await initTestServer(port); ws = await initWs(port); diff --git a/apps/team-up/src/app/modules/board/components/header/header.component.spec.ts b/apps/team-up/src/app/modules/board/components/header/header.component.spec.ts deleted file mode 100644 index 9276245f..00000000 --- a/apps/team-up/src/app/modules/board/components/header/header.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { HeaderComponent } from './header.component'; - -describe('HeaderComponent', () => { - let component: HeaderComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [HeaderComponent], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(HeaderComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/apps/team-up/src/app/modules/board/components/svg-icon/svg-icon.component.spec.ts b/apps/team-up/src/app/modules/board/components/svg-icon/svg-icon.component.spec.ts deleted file mode 100644 index ec59b34d..00000000 --- a/apps/team-up/src/app/modules/board/components/svg-icon/svg-icon.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SvgIconComponent } from './svg-icon.component'; - -describe('SvgIconComponent', () => { - let component: SvgIconComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [SvgIconComponent], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(SvgIconComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/libs/utils/README.md b/libs/utils/README.md index a44171ed..b6583b1f 100644 --- a/libs/utils/README.md +++ b/libs/utils/README.md @@ -5,7 +5,3 @@ This library was generated with [Nx](https://nx.dev). ## Building Run `nx build utils` to build the library. - -## Running unit tests - -Run `nx test utils` to execute the unit tests via [Vitest](https://vitest.dev/). diff --git a/libs/utils/tsconfig.json b/libs/utils/tsconfig.json index 9ee7a346..48222dae 100644 --- a/libs/utils/tsconfig.json +++ b/libs/utils/tsconfig.json @@ -15,8 +15,5 @@ { "path": "./tsconfig.lib.json", }, - { - "path": "./tsconfig.spec.json", - }, ], } diff --git a/libs/utils/tsconfig.lib.json b/libs/utils/tsconfig.lib.json index 56bc5e5c..faa09cc1 100644 --- a/libs/utils/tsconfig.lib.json +++ b/libs/utils/tsconfig.lib.json @@ -3,8 +3,8 @@ "compilerOptions": { "outDir": "../../dist/out-tsc", "declaration": true, - "types": ["node", "vite/client"] + "types": ["node"] }, "include": ["src/**/*.ts"], - "exclude": ["vite.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] } diff --git a/libs/utils/tsconfig.spec.json b/libs/utils/tsconfig.spec.json deleted file mode 100644 index 23308071..00000000 --- a/libs/utils/tsconfig.spec.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc", - "types": [ - "vitest/globals", - "vitest/importMeta", - "vite/client", - "node", - "vitest" - ] - }, - "include": [ - "vite.config.ts", - "vitest.config.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] -} diff --git a/libs/utils/vite.config.ts b/libs/utils/vite.config.ts deleted file mode 100644 index b315f01f..00000000 --- a/libs/utils/vite.config.ts +++ /dev/null @@ -1,62 +0,0 @@ -/// -import { defineConfig } from 'vite'; -import dts from 'vite-plugin-dts'; -import * as path from 'path'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; - -export default defineConfig({ - root: __dirname, - cacheDir: '../../node_modules/.vite/libs/utils', - - plugins: [ - nxViteTsPaths(), - dts({ - entryRoot: 'src', - tsConfigFilePath: path.join(__dirname, 'tsconfig.lib.json'), - skipDiagnostics: true, - }), - ], - - // Uncomment this if you are using workers. - // worker: { - // plugins: [ nxViteTsPaths() ], - // }, - - // Configuration for building your library. - // See: https://vitejs.dev/guide/build.html#library-mode - build: { - outDir: '../../dist/libs/utils', - reportCompressedSize: true, - commonjsOptions: { - transformMixedEsModules: true, - }, - lib: { - // Could also be a dictionary or array of multiple entry points. - entry: 'src/index.ts', - name: 'utils', - fileName: 'index', - // Change this to the formats you want to support. - // Don't forget to update your package.json as well. - formats: ['es', 'cjs'], - }, - rollupOptions: { - // External packages that should not be bundled into your library. - external: [], - }, - }, - - test: { - globals: true, - cache: { - dir: '../../node_modules/.vitest', - }, - environment: 'node', - include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], - - reporters: ['default'], - coverage: { - reportsDirectory: '../../coverage/libs/utils', - provider: 'v8', - }, - }, -}); diff --git a/package.json b/package.json index 3eae3d42..97fb3eab 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "start:api": "nx serve api", "build": "npm run config && nx build", "migrate": "nx run api:migrate", - "test": "nx test", + "test": "nx run-many --target=test --exclude='api'", + "e2e:tests": "nx run test api", "start:docker": "cd docker && docker compose --env-file=../.env up -d", "stop:docker": "cd docker && docker compose --env-file=../.env down", "start:docker:clean": "cd docker && docker compose --env-file=../.env up -d --force-recreate --build",