Skip to content

redisStore is not ending when tests finishes #58

@ejose19

Description

@ejose19

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({});

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions