mardi 3 septembre 2019

Loopback 4: Test never end when there is a connection with a MongoDB

Launch npm test, but it never end. It happens when there is a connection with a MongoDB involve. It is rare because the test works, but it never ends.

before('setupApplication', async () => {
        ({ app, client } = await setupApplication());
        //await prepareTestData()
    });

    after(async () => {
        //await cleanupTestData();
        await app.stop();
    });

    it('login with a test user', async () => {
        const res = await client.post('/user-accounts/login').set('urlLogin', TEST_TENANT_URL)
            .send({
                email: TEST_EMAIL,
                password: TEST_PASS
            }).expect(200);
        token = res.body.token;
        expect(res.body).to.ownProperty("token").and.length(EXPECTED_TOKEN_LENGTH);
        console.log("Logged in with token ", res.body.token);
    });

The problem: The terminal never end. Is like a thread still working. I don´t know if it is a problem with loopback or what.

Any idea? I hope somebody could help me.

Thanks.

Aucun commentaire:

Enregistrer un commentaire