Skip to content

Commit

Permalink
fix(vite-dev-server): import cypress client script asynchronously to …
Browse files Browse the repository at this point in the history
…avoid flake (#15778)

* fix: load script test last to avoid flake

* chore: comment loading the cypress client last
  • Loading branch information
Barthélémy Ledoux authored Apr 3, 2021
1 parent 358628f commit 88a3830
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion npm/vite-dev-server/src/makeCypressPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ export const makeCypressPlugin = (
},
transformIndexHtml () {
return [
// load the script at the end of the body
// script has to be loaded when the vite client is connected
{
tag: 'script',
attrs: { type: 'module', src: INIT_FILEPATH },
injectTo: 'body',
attrs: { type: 'module' },
children: `import(${JSON.stringify(INIT_FILEPATH)})`,
},
]
},
Expand Down

4 comments on commit 88a3830

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 88a3830 Apr 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.9.0/circle-develop-88a3830d68ef71290ecad3ab7ba440370f314741/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 88a3830 Apr 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.7.2/appveyor-develop-88a3830d68ef71290ecad3ab7ba440370f314741/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 88a3830 Apr 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.7.2/appveyor-develop-88a3830d68ef71290ecad3ab7ba440370f314741/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 88a3830 Apr 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.9.0/circle-develop-88a3830d68ef71290ecad3ab7ba440370f314741/cypress.tgz

Please sign in to comment.