Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(e2e): add test suite for sass, less and stylus #30098

Merged
merged 2 commits into from
Mar 9, 2021

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Mar 8, 2021

Description

This is to prevent scenarios like we had with #30038 where we introduced uncaught regression and had to revert

[ch26425]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 8, 2021
@pieh pieh removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 8, 2021
@LekoArts LekoArts added the topic: automation Related to Circle CI, Peril, Renovate, scripts/*, Github Workflows, Github Actions, or Slackbot label Mar 9, 2021
Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

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

LGTM. I like that you add the color on the wrapping div and test both with normal file + module file 👍

Did you want to to any assertion with hmrConsoleLog?

@pieh
Copy link
Contributor Author

pieh commented Mar 9, 2021

Did you want to to any assertion with hmrConsoleLog?

Implicit assertions with cy.waitForHmr() after I edit something part - I mostly care about waiting for HMR to finish on browser side so when asserting color change we know HMR did finish there already. I need to spy it myself because that's usually done setup with cy.visit in

// overwriting visit and creating a waitForHmr function to help us deal with HMR
Cypress.Commands.overwrite("visit", (orig, url, options = {}) => {
const newOptions = {
...options,
onBeforeLoad: win => {
if (options.onBeforeLoad) {
options.onBeforeLoad(win)
}
cy.spy(win.console, "log").as(`hmrConsoleLog`)
},
}
return orig(url, newOptions)
})
but I actually don't want to refresh / visit page - I want to make sure I visit once and then rely on HMR updates to see style changes reflected without need to refresh

@pieh pieh merged commit 7a1ea66 into master Mar 9, 2021
@pieh pieh deleted the test-e2e-sass-less-stylus branch March 9, 2021 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: automation Related to Circle CI, Peril, Renovate, scripts/*, Github Workflows, Github Actions, or Slackbot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants