mercredi 23 septembre 2020

Getting No Tests Found In your File error, but I do have a test written

I am trying to run the following test on Cypress, but I am getting this error: No tests found in your file: /Users/Name/Desktop/MyFolder/cypress-tutorial-build-todo-starter/cypress/integration/app-init.spec.js We could not detect any tests in the above file. Write some tests and re-run.

I thought I did have a test written as you can see below, especially since I have the it function. Can someone tell me why I may be getting this error? This is the second file I have with a test in my integration folder. Not sure if that makes a difference.

const todos = [
    {
      "id": 1,
      "name": "Buy Milk",
      "isComplete": false
    },
    {
      "id": 2,
      "name": "Buy Eggs",
      "isComplete": false
    },
    {
      "id": 3,
      "name": "Buy Bread",
      "isComplete": false
    },
    {
      "id": 4,
      "name": "Make French Toast",
      "isComplete": false
    }
  ]
  
  describe('App Initialization', () => {
    it.only('Loads todos on page load', () => {
    cy.server()
    cy.route('GET', '/api/todos', todos)
    cy.visit('/')
    })
  
    cy.get('.todo-list li')
      .should('have.length', 4)
  })

Aucun commentaire:

Enregistrer un commentaire