Skip to content

Commit

Permalink
set up jest
Browse files Browse the repository at this point in the history
  • Loading branch information
chentsulin committed Nov 25, 2016
1 parent e9a12ff commit 1b7bf5d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "4catalyzer-react"
"extends": "4catalyzer-react",
"env": {
"jest": true
}
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build": "rimraf lib && babel src -d lib",
"lint": "eslint examples/*/src src test *.js",
"prepublish": "npm run build",
"test": "npm run lint"
"testonly": "jest",
"test": "npm run lint && npm run testonly"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -47,6 +48,7 @@
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-eslint": "^7.1.0",
"babel-jest": "^17.0.2",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-transform-runtime": "^6.15.0",
Expand All @@ -58,8 +60,12 @@
"eslint-plugin-import": "^1.16.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.5.0",
"jest": "^17.0.3",
"react": "^15.3.2",
"react-dom": "^15.3.2",
"rimraf": "^2.5.4"
},
"jest": {
"rootDir": "src"
}
}
12 changes: 12 additions & 0 deletions src/jsx/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {
makeRouteConfig,
Redirect,
Route,
} from '../';


it('exports correctly', () => {
expect(makeRouteConfig).toBeDefined();
expect(Redirect).toBeDefined();
expect(Route).toBeDefined();
});

0 comments on commit 1b7bf5d

Please sign in to comment.