Skip to content

Commit

Permalink
Make jest run all tests in packages
Browse files Browse the repository at this point in the history
And add trivial test for mymain.
  • Loading branch information
untsamphan committed Jun 14, 2018
1 parent 60fb5e9 commit ef0b506
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
9 changes: 9 additions & 0 deletions packages/mymain/src/Main.test.tsx
@@ -0,0 +1,9 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Main } from './Main';

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Main />, div);
ReactDOM.unmountComponentAtNode(div);
});
13 changes: 11 additions & 2 deletions webapp/package.json
Expand Up @@ -57,15 +57,19 @@
"typescript": "^2.9.1"
},
"jest": {
"roots": [
"<rootDir>/src",
"<rootDir>/../packages"
],
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.(j|t)s?(x)",
"<rootDir>/src/**/?(*.)(spec|test).(j|t)s?(x)"
"**/src/**/__tests__/**/*.(j|t)s?(x)",
"**/src/**/?(*.)(spec|test).(j|t)s?(x)"
],
"testEnvironment": "node",
"testURL": "http://localhost",
Expand All @@ -81,6 +85,11 @@
"moduleNameMapper": {
"^react-native$": "react-native-web"
},
"moduleDirectories": [
"node_modules",
"../node_modules",
"../packages"
],
"moduleFileExtensions": [
"web.ts",
"ts",
Expand Down

0 comments on commit ef0b506

Please sign in to comment.