LinbuduLab / esbuild-plugins

ESBuild plugins by @LinbuduLab
MIT License
113 stars 18 forks source link

E2E: e2e project does not work with vite-plugin #78

Closed vincent-thomas closed 2 years ago

vincent-thomas commented 2 years ago

Hi! I'm using the vite plugin with my react app. I think the problem is that the e2e tests doesn't start until the vite serve command finishes, but that command never finishes


// e2e project.json
"e2e": {
  "executor": "@nrwl/cypress:cypress",
  "options": {
    "cypressConfig": "apps/e2e/[name]/cypress.json",
    "devServerTarget": "[name]:serve",
    "headed": true
  },
  "configurations": {
    "production": {
      "devServerTarget": "[name]:serve:production"
    }
  }
}
// app project.json
"serve": {
  "executor": "nx-plugin-vite:serve",
  "options": {
    "configFile": "apps/[name]/vite.config.ts",
    "port": 3000,
    "host": true,
    "https": false,
    "root": "apps/[name]"
  }
}

Error:

[ vincent@PC ] :: 21:27:24 >> Codebase.js λ nx e2e thunder-e2e

> nx run thunder-e2e:e2e

i Nx-Vite [Start] Starting 

√ Vite server ready at http://localhost:3000

# nothing happens here... No test results or anything
linbudu599 commented 2 years ago

I've never used nx cypress plugin before, so I need to try it once before I can locate where the problem is.

vincent-thomas commented 2 years ago

Did you see what the problem was?

linbudu599 commented 2 years ago

Did you see what the problem was?

I have confirmed the problem, this will be fixed in next minor version soon.

linbudu599 commented 2 years ago

@VincentThomas06 This was fixed in the latest versiob 1.5.1, you can have a try for Cypress integration now.

vincent-thomas commented 2 years ago

@VincentThomas06 This was fixed in the latest versiob 1.5.1, you can have a try for Cypress integration now.

Great! I'll see if it works and if it does, i'll close this issue.