Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@storybook/test
Advanced tools
The @storybook/test
package contains utilities for testing your stories inside play
functions.
Install the package by adding the @storybook/test
dev dependency:
npm install -D @storybook/test
pnpm add -D @storybook/test
yarn add -D @storybook/test
Note that this package is not an addon, so you don't have to add it to your main.js/main.ts
file.
The test package exports instrumented versions of @vitest/spy, @vitest/expect (based on chai), @testing-library/dom and @testing-library/user-event. The instrumentation makes sure you can debug those methods in the addon-interactions panel.
// Button.stories.ts
import { Button } from './Button';
import { within, userEvent, expect, fn } from '@storybook/test';
export default {
component: Button,
args: {
onClick: fn(),
},
};
export const Demo = {
play: async ({ args, canvasElement }) => {
const canvas = within(canvasElement);
await userEvent.click(canvas.getByRole('button'));
await expect(args.onClick).toHaveBeenCalled();
},
};
7.6.0
Storybook 7.6 is here with increased performance and much more!
@storybook/core-events/preview-errors
dependency missing for Yarn PnP - #24973, thanks @JReinhold!react
and Storybook packages devDependencies
where possible - #24676, thanks @JReinhold!react
and Storybook packages devDependencies
where possible - ATTEMPT 2 - #24834, thanks @JReinhold!addon-onboarding
when checking versions - #24634, thanks @JReinhold!useStoryPrepared
hook failing with undefined
data - #22631, thanks @SpookyJelly!of
prop to Primary
block - #23849, thanks @Wilson2k!defaultProps
in Stories
block - #24506, thanks @WouterK12!store.settings.lastTrackedStoryId
- #24115, thanks @rashidshamloo!"type": "commonjs"
compatibility - #24534, thanks @ndelangen!react-docgen
to v7 - #24530, thanks @shilman!SlotDecorator
component - #24800, thanks @JReinhold!goto
, invalidate
and invalidateAll
- #24955, thanks @paoloricciuti!--test
CLI-flag - #24862, thanks @ndelangen!--test
is true
- #24799, thanks @ndelangen!@storybook/blocks
if build.test.emptyBlocks
is true
- #24650, thanks @ndelangen!FAQs
Unknown package
The npm package @storybook/test receives a total of 1,286,581 weekly downloads. As such, @storybook/test popularity was classified as popular.
We found that @storybook/test demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.