mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-18 05:02:24 +08:00
re-move addon-jest config & script to official-storybook
This commit is contained in:
parent
1df4c87e6e
commit
8a69e8baa5
@ -1,29 +0,0 @@
|
||||
{
|
||||
"verbose": true,
|
||||
"coverageDirectory": "coverage/",
|
||||
"notify": true,
|
||||
"transform": {
|
||||
".*": "babel-jest"
|
||||
},
|
||||
"snapshotSerializers": [
|
||||
"enzyme-to-json/serializer"
|
||||
],
|
||||
"setupFiles": [
|
||||
"<rootDir>/src/enzyme.js"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/../../__mocks__/fileMock.js",
|
||||
"\\.s?css$": "<rootDir>/../../__mocks__/styleMock.js"
|
||||
},
|
||||
"collectCoverage": true,
|
||||
"collectCoverageFrom": [
|
||||
"src/**/*.js",
|
||||
"src/*.js",
|
||||
"!src/.*",
|
||||
"!src/__test__/*",
|
||||
"!src/**/__test__/*",
|
||||
"!src/**/index.js",
|
||||
"!src/**/story.js"
|
||||
],
|
||||
"testMatch": ["<rootDir>/src/addon-jest.runner.js"]
|
||||
}
|
@ -5,7 +5,6 @@
|
||||
"build": "react-scripts build",
|
||||
"build-storybook": "build-storybook -s public",
|
||||
"eject": "react-scripts eject",
|
||||
"generate-addon-jest-testresults": "jest --config=config-addon-jest.json --env=jsdom --json --outputFile=src/stories/addon-jest.testresults.json",
|
||||
"start": "react-scripts start",
|
||||
"storybook": "start-storybook -p 9010 -s public",
|
||||
"test": "react-scripts test --env=jsdom"
|
||||
|
@ -1,4 +0,0 @@
|
||||
import Enzyme from 'enzyme';
|
||||
import Adapter from 'enzyme-adapter-react-16';
|
||||
|
||||
Enzyme.configure({ adapter: new Adapter() });
|
@ -1 +0,0 @@
|
||||
import './enzyme';
|
File diff suppressed because one or more lines are too long
@ -5,6 +5,7 @@
|
||||
"build-storybook": "build-storybook -c ./",
|
||||
"storybook": "start-storybook -p 9010 -c ./",
|
||||
"chromatic": "chromatic test --storybook-addon --exit-zero-on-changes --app-code ab7m45tp9p",
|
||||
"generate-addon-jest-testresults": "jest --config=tests/addon-jest.config.json --json --outputFile=stories/addon-jest.testresults.json",
|
||||
"image-snapshots": "yarn run build-storybook && jest --projects=./image-snapshots"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
File diff suppressed because one or more lines are too long
19
examples/official-storybook/tests/addon-jest.config.json
Normal file
19
examples/official-storybook/tests/addon-jest.config.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"rootDir": "../../..",
|
||||
"verbose": true,
|
||||
"coverageDirectory": "coverage/",
|
||||
"notify": true,
|
||||
"transform": {
|
||||
".*": "babel-jest"
|
||||
},
|
||||
"snapshotSerializers": [
|
||||
"enzyme-to-json/serializer"
|
||||
],
|
||||
"setupFiles": ["raf/polyfill"],
|
||||
"setupTestFrameworkScriptFile": "<rootDir>/scripts/jest.init.js",
|
||||
"moduleNameMapper": {
|
||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>__mocks__/fileMock.js",
|
||||
"\\.s?css$": "<rootDir>__mocks__/styleMock.js"
|
||||
},
|
||||
"testMatch": ["<rootDir>/examples/official-storybook/tests/addon-jest.test.js"]
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
// This file is excluded from the `/scripts/test.js` script. (see root `jest.config.js` file)
|
||||
test('true should be true', () => {
|
||||
expect(true).toBe(true);
|
||||
});
|
@ -1,3 +1,4 @@
|
||||
import path from 'path';
|
||||
import initStoryshots, { multiSnapshotWithOptions } from '@storybook/addon-storyshots';
|
||||
import { render as renderer } from 'enzyme';
|
||||
import serializer from 'enzyme-to-json';
|
||||
@ -5,7 +6,7 @@ import serializer from 'enzyme-to-json';
|
||||
// HTML Snapshots
|
||||
initStoryshots({
|
||||
framework: 'react',
|
||||
configPath: __dirname,
|
||||
configPath: path.join(__dirname, '../'),
|
||||
test: multiSnapshotWithOptions({
|
||||
renderer,
|
||||
serializer,
|
Loading…
x
Reference in New Issue
Block a user