Skip to content

Commit ad6cfb0

Browse files
committed
Add a simple default test
1 parent d1a7226 commit ad6cfb0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\"",
1616
"e2e": "tasks/e2e.sh",
1717
"start": "node scripts/start.js --debug-template",
18-
"test": "node scripts/test.js --debug-template --watch"
18+
"test": "node scripts/test.js --debug-template --watch --env=jsdom"
1919
},
2020
"files": [
2121
"PATENTS",

scripts/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = function(appPath, appName, verbose, originalDirectory) {
2626
appPackage.scripts = {
2727
'start': 'react-scripts start',
2828
'build': 'react-scripts build',
29-
'test': 'react-scripts test --watch',
29+
'test': 'react-scripts test --watch --env=jsdom',
3030
'eject': 'react-scripts eject'
3131
};
3232

template/src/App.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import App from './App';
4+
5+
describe('App', () => {
6+
it('renders without crashing', () => {
7+
const div = document.createElement('div');
8+
ReactDOM.render(<App />, div);
9+
});
10+
});

0 commit comments

Comments
 (0)