mirror of
https://github.com/nestjs/nest.git
synced 2026-10-28 09:45:43 +08:00
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:
1 file changed
+17
@@ -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()],
|
||||
});
|
||||
Reference in new issue
Block a user