1
votes

I am doing a unit test. Cypress now gives an errror. it cannot find the test. but in the login.js file I have written code. I don't understand why it can't find the test, it does exist.

the testcode:

describe("login", () => {
beforeEach(() => {
    cy.visit("http://localhost:8080");
});

});

The error:

integration\login.js

We could not detect any tests in the above file. Write some tests and re-run.

Path:

server/cypress/integration/pad/login.js

1
please fix the code link ;)voy

1 Answers

2
votes

If this is all of your test code, it really doesn't have any test. Add any 'it' and cypress will recognize it as a test.

describe("login", () => { 
    beforeEach(() => {
        cy.visit("http://localhost:8080");
    });

    it('Example test', () => {
        expect(add(1, 2)).to.eq(3)
    })

});