Skip to content

Commit ea68c13

Browse files
committed
Update template tests to follow all of @gaearon's excellent advice.
1 parent 7ba7ead commit ea68c13

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

react-native-scripts/src/scripts/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = async (appPath: string, appName: string, verbose: boolean) => {
3838
eject: 'react-native-scripts eject',
3939
android: 'react-native-scripts android',
4040
ios: 'react-native-scripts ios',
41-
test: 'node node_modules/jest/bin/jest.js',
41+
test: 'node node_modules/jest/bin/jest.js --watch',
4242
};
4343

4444
appPackage.jest = {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
import ReactNative from "react-native";
3+
import App from "./App";
4+
5+
// this is included from the jest-expo preset
6+
// make sure to include it in package.json yourself if you change the jest preset
7+
import renderer from "react-test-renderer";
8+
9+
it("renders without crashing", () => {
10+
const tree = renderer.create(<App />);
11+
});

react-native-scripts/template/__tests__/App.test.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)