Skip to content

Commit

Permalink
fix(svelte): default mount log to true (#23771)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachJW34 committed Sep 12, 2022
1 parent f07a49b commit 96b03ab
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion npm/svelte/src/mount.ts
Expand Up @@ -76,7 +76,7 @@ export function mount<T extends SvelteComponent> (
// by waiting, we are delaying test execution for the next tick of event loop
// and letting hooks and component lifecycle methods to execute mount
return cy.wait(0, { log: false }).then(() => {
if (options.log) {
if (options.log !== false) {
const mountMessage = `<${getComponentDisplayName(Component)} ... />`

Cypress.log({
Expand Down
30 changes: 30 additions & 0 deletions system-tests/project-fixtures/svelte/src/mount.cy.js
Expand Up @@ -53,4 +53,34 @@ describe("Svelte mount", () => {
cy.then(() => messageStore.set("Written from spec"));
cy.contains("h1", "Written from spec");
});

context("log", () => {
it("displays component name in mount log", () => {
cy.mount(Counter);

cy.wrap(Cypress.$(window.top.document.body)).within(() =>
cy
.contains("displays component name in mount log")
.closest(".collapsible")
.click()
.within(() =>
cy
.get(".command-name-mount")
.should("contain", "mount<Counter ... />")
)
);
});

it("does not display mount log", () => {
cy.mount(Counter, { log: false });

cy.wrap(Cypress.$(window.top.document.body)).within(() =>
cy
.contains("does not display mount log")
.closest(".collapsible")
.click()
.within(() => cy.get(".command-name-mount").should("not.exist"))
);
});
});
});

5 comments on commit 96b03ab

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 96b03ab Sep 12, 2022

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/10.8.0/linux-x64/develop-96b03abc74cd7b27ef4bbd9b66d9464c1f9fc2f2/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 96b03ab Sep 12, 2022

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 arm64 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/10.8.0/linux-arm64/develop-96b03abc74cd7b27ef4bbd9b66d9464c1f9fc2f2/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 96b03ab Sep 12, 2022

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 arm64 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/10.8.0/darwin-arm64/develop-96b03abc74cd7b27ef4bbd9b66d9464c1f9fc2f2/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 96b03ab Sep 12, 2022

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/10.8.0/darwin-x64/develop-96b03abc74cd7b27ef4bbd9b66d9464c1f9fc2f2/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 96b03ab Sep 12, 2022

Choose a reason for hiding this comment

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

Circle 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/10.8.0/win32-x64/develop-96b03abc74cd7b27ef4bbd9b66d9464c1f9fc2f2/cypress.tgz

Please sign in to comment.