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

Add CLI wrapper #41

Merged
merged 1 commit into from
Feb 3, 2022
Merged

Add CLI wrapper #41

merged 1 commit into from
Feb 3, 2022

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Feb 3, 2022

Issue: SB-20

What I did

This PR adds a CLI wrapper with the following commands:

image

It will retain test runner configs and pass the rest to jest-playwright. If users end up trying a flag that is not supported, they will get an error message with a link to open an issue on this repo:
image

📦 Published PR as canary version: 0.0.2-canary.41.9b77c29.0

✨ Test out this PR locally via:

npm install @storybook/test-runner@0.0.2-canary.41.9b77c29.0
# or 
yarn add @storybook/test-runner@0.0.2-canary.41.9b77c29.0

Version

Published prerelease version: v0.0.2-next.6

Changelog

🐛 Bug Fix

⚠️ Pushed to next

📝 Documentation

  • docs(README): add section about jest #29 (@yannbf)

Authors: 2

@yannbf yannbf added the feature request New feature or request label Feb 3, 2022
@yannbf yannbf requested a review from shilman February 3, 2022 12:26
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Great stuff. Minor stuff

@@ -1,10 +1,12 @@
import dedent from 'ts-dedent';
import path from 'path';
import * as coreCommon from '@storybook/core-common';
import * as cli from '../util/cli';

import { transformPlaywright } from './transformPlaywright';

jest.mock('@storybook/core-common');
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need to mock this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, because of the jest.spyOn(coreCommon, 'normalizeStories') code below

src/util/cli.ts Outdated Show resolved Hide resolved
bin/test-storybook.js Outdated Show resolved Hide resolved
@shilman shilman changed the title feat: add CLI wrapper SB-20 Add CLI wrapper Feb 3, 2022
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Great job @yannbf !!

@shilman shilman merged commit 86ed1e9 into next Feb 3, 2022
@shilman shilman deleted the feat/cli-wrapper branch February 3, 2022 17:19
@yannbf yannbf mentioned this pull request Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants