Permalink
Browse files

Add first working test

The test is not really meaningful and I'll probably delete it but
I needed a way to test the tooling was working.
  • Loading branch information...
lucapette committed Feb 28, 2017
1 parent c606284 commit e1cf07690f77ff0c628c0541730edc12fa7e90a7
Showing with 768 additions and 29 deletions.
  1. +3 −0 .babelrc
  2. +4 −1 package.json
  3. +8 −0 src/timer.js
  4. +6 −0 src/timer.test.js
  5. +747 −28 yarn.lock
View
@@ -0,0 +1,3 @@
+{
+ "presets": ["es2015", "react"]
+}
View
@@ -9,6 +9,7 @@
"dependencies": {
"babel-cli": "^6.22.2",
"babel-core": "^6.22.1",
+ "babel-jest": "^19.0.0",
"babel-loader": "^6.2.10",
"babel-plugin-transform-class-properties": "^6.22.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
@@ -17,6 +18,7 @@
"css-loader": "^0.26.1",
"extract-text-webpack-plugin": "beta",
"flow-bin": "^0.38.0",
+ "jest": "^19.0.2",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"semantic-ui-css": "^2.2.4",
@@ -29,6 +31,7 @@
"scripts": {
"start": "node_modules/.bin/webpack-dev-server --open",
"build": "node_modules/.bin/webpack --config webpack.config.js",
- "flow": "flow; test $? -eq 0 -o $? -eq 2"
+ "flow": "flow; test $? -eq 0 -o $? -eq 2",
+ "test": "jest"
}
}
View
@@ -0,0 +1,8 @@
+//@flow
+
+export default class Timer {
+ constructor(minutes = 25) {
+ this.minutes = minutes;
+ this.callbacks = [];
+ }
+}
View
@@ -0,0 +1,6 @@
+import Timer from './timer'
+
+test('it has defaults', () => {
+ var timer = new Timer();
+ expect(timer.minutes).toBe(25);
+});
Oops, something went wrong.

0 comments on commit e1cf076

Please sign in to comment.