Comments (3)
app.e2e-spec.ts:
import { AppModule } from '../src/app.module';
import { INestApplication } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import request from 'supertest';
describe('AppController (e2e)', () => {
let app: INestApplication;
beforeAll(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();
app = moduleFixture.createNestApplication();
await app.init();
});
afterAll(async () => {
await app.close();
});
it('/ (GET)', () => request(app.getHttpServer()).get('/').expect(200).expect('Hello World!'));
});
Test output:
PASS apps/api/test/app.e2e-spec.ts (28.075 s)
AppController (e2e)
✓ / (GET) (21 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 28.726 s, estimated 31 s
Ran all test suites matching /app.e2e/i.
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
from nestjs-redis.
You can try to set closeClient
option to true and try it again.
from nestjs-redis.
Version 5.1.1 has been released, install new version and try it again.
from nestjs-redis.
Related Issues (20)
- [Question]Set readyLog True make logger keep logging for every 3 seconds... HOT 4
- Connection closes after request
- Nest can't resolve dependencies of the TemplateService (?). Please make sure that the argument Model at index [0] is available in the TemplateModule context
- ClientNotFoundError: Redis client "default" was not found in the application context. HOT 4
- Nestjs V9 support HOT 4
- WRONGPASS invalid username-password with docker compose HOT 2
- enableShutdownHooks error HOT 8
- redis json HOT 2
- Handling connection error HOT 1
- Redis client "default" was not found in the application context. HOT 5
- Jest not exiting due to Redis hanging after compilation error with createTestingModule HOT 6
- Rediss:// connection returns error HOT 2
- Nest can't resolve dependencies of the RedisManager inside Jest test
- Testing: Mocking for App Module not working HOT 3
- Redis Sentinel Configuration HOT 1
- Redis Connection Hangup when trying to do any set/get methods with Nestjs HOT 2
- Type error with ioredis 5.3.x
- Error: connect ETIMEDOUT HOT 1
- Update Nestjs dependencies HOT 19
- Can't resolve dependencies in yarn workspaces HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nestjs-redis.