re-move addon-jest config & script to official-storybook

This commit is contained in:
Thomas Bertet 2018-01-04 18:28:02 +01:00
parent 1df4c87e6e
commit 8a69e8baa5
10 changed files with 24 additions and 38 deletions

View File

@ -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"]
}

View File

@ -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"

View File

@ -1,4 +0,0 @@
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
Enzyme.configure({ adapter: new Adapter() });

View File

@ -1 +0,0 @@
import './enzyme';

File diff suppressed because one or more lines are too long

View File

@ -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

View 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"]
}

View File

@ -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);
});

View File

@ -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,