test: resolve nest packages from this checkout in integration tests

The @nestjs/* packages installed from npm (graphql, apollo, mongoose,
typeorm) import @nestjs/core and @nestjs/common from where they are
installed. When node_modules is linked to another checkout, as in a git
worktree that shares the main checkout's node_modules, that is a second
copy of every class. Dependency injection then failed (GraphQLModule
could not resolve HttpAdapterHost), so every graphql-schema-first spec
failed in such a checkout while CI passed.

The integration config now dedupes the packages of this repository, so
Vite resolves them from the project root whoever imports them. Nothing
changes where node_modules is installed in place.
This commit is contained in:
Kamil Myśliwiec committed 2026-10-19 10:22:20 +02:00
1 parent ecc5b26d43
commit 6e345edc1b
1 file changed
+17
+17
View File
@@ -73,5 +73,22 @@ export default defineConfig({
reporters: ['default'],
fileParallelism: false,
},
resolve: {
// The @nestjs/* packages that live in node_modules import the packages of
// this repository from where they are installed. When node_modules is
// linked to another checkout (e.g. in a git worktree), that is a second
// copy of every class (HttpAdapterHost), so they are resolved from here.
dedupe: [
'@nestjs/common',
'@nestjs/core',
'@nestjs/microservices',
'@nestjs/platform-express',
'@nestjs/platform-fastify',
'@nestjs/platform-socket.io',
'@nestjs/platform-ws',
'@nestjs/testing',
'@nestjs/websockets',
],
},
plugins: [resolveTypescriptSource()],
});