We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A very simplified code to view the problem:
app.ts
import * as Koa from "koa"; import * as redisStore from "koa-redis"; const app = new Koa(); const store = redisStore({}); export default app;
app.test.ts
import * as supertest from "supertest"; import app from "../src/app"; const request = supertest(app.callback()); describe("test", () => { test("route GET /", async () => { const response = await request.get("/"); expect(response.status).toEqual(404); }); });
Jest complains that "there are asynchronous operations that weren't stopped in your tests", if I comment out const store = redisStore({});
const store = redisStore({});
then it closes as expected, so I figured the issue is caused by this library. Anything I need to implement in code/tests or this is a bug?
The text was updated successfully, but these errors were encountered:
As a workaround, I'm doing this:
on app.ts
const store: any = redisStore({}); app.on("close", () => { store.client.disconnect(); });
afterAll(() => { app.emit("close"); });
Had to use :any to the store as it's not detecting client without it, honestly this seems a bit ugly and a better solution is expected.
Sorry, something went wrong.
No branches or pull requests
A very simplified code to view the problem:
app.ts
app.test.ts
Jest complains that "there are asynchronous operations that weren't stopped in your tests", if I comment out
const store = redisStore({});
then it closes as expected, so I figured the issue is caused by this library. Anything I need to implement in code/tests or this is a bug?
The text was updated successfully, but these errors were encountered: