Skip to content

Commit 4ec6489

Browse files
authored
Update migration.md
Added TestingModule / NestFactory as I had to change a lot, especially in my e2e tests to support v8. Please review.
1 parent ff47ece commit 4ec6489

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

content/migration.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,23 @@ Also, all `HttpException` errors thrown from your resolvers will be now automati
9191
#### RxJS
9292

9393
Make sure to upgrade to the latest version of the `rxjs` package (v7).
94+
95+
#### TestingModule / NestFactory
96+
97+
If you are currently getting an element (in this case `ConfigService`) from the module using a string you'll receive following error:
98+
```
99+
Nest could not find ConfigService element (this provider does not exist in the current context)
100+
```
101+
102+
Please change this to the actual reference.
103+
Before:
104+
```typescript
105+
const app = await NestFactory.create<NestExpressApplication>(AppModule);
106+
const config = app.get<ConfigService>('ConfigService');
107+
```
108+
109+
Now:
110+
```typescript
111+
const app = await NestFactory.create<NestExpressApplication>(AppModule);
112+
const config = app.get<ConfigService>(ConfigService);
113+
```

0 commit comments

Comments
 (0)