[change] introduce Jest preset

A simple Jest preset that configures module mapping and produces
human-readable styles (i.e., not converted to numeric form).

Fix #928
Fix #963
This commit is contained in:
Nicolas Gallagher
2018-06-04 11:40:07 -07:00
parent 4f9216853b
commit 8f0c39c2fe
7 changed files with 35 additions and 403 deletions
+3 -4
View File
@@ -2,10 +2,9 @@
import Adapter from 'enzyme-adapter-react-16';
import Enzyme from 'enzyme';
import createSerializer from '../../packages/react-native-web/jest/createSerializer';
import { StyleSheet } from '../../packages/react-native-web/src';
const serializer = createSerializer(StyleSheet);
import serializer from './serializer';
Enzyme.configure({ adapter: new Adapter() });
// TODO: move off legacy serializer
expect.addSnapshotSerializer(serializer);