-
Notifications
You must be signed in to change notification settings - Fork 72
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
Do not prompt to install chromatic script during E2E builds #941
Do not prompt to install chromatic script during E2E builds #941
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
export function isE2EBuild(options: Options) { | ||
return options.playwright || options.cypress; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. We could use this for the "flag the project as e2e" thing in the future (if we ever feel the need to handle projects switching from storybook-e2e or vice versa).
it('does not propmpt you to add a script to your package.json for E2E builds', async () => { | ||
const ctx = getContext(['--project-token=asdf1234', '--playwright']); | ||
await runAll(ctx); | ||
const spy = vi.spyOn(checkPackageJson, 'default'); | ||
expect(spy).not.toHaveBeenCalled(); | ||
expect(confirm).not.toHaveBeenCalled(); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test.
🚀 PR was released in |
The CLI will prompt to install a chromatic script if one does not already exist in
package.json
. This will be the wrong command for E2E builds and may be missing necessary env vars. This disables that for E2E builds for the time being.📦 Published PR as canary version:
11.0.5--canary.941.8178177052.0
✨ Test out this PR locally via: