From 505dd353cd055594cfbd01e3ec97b0df347b66ac Mon Sep 17 00:00:00 2001 From: Leland Richardson Date: Mon, 11 Apr 2016 12:17:16 -0700 Subject: [PATCH] Fix npm test --- .babelrc | 3 +++ .npmignore | 2 +- package.json | 4 +++- test/Actions.test.js | 10 +++++----- 4 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 000000000..6e9bad519 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + presets: ["react-native"] +} diff --git a/.npmignore b/.npmignore index e2687ef57..a72b3d772 100755 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,3 @@ Example/ .idea - +.babelrc diff --git a/package.json b/package.json index 20604a8db..03d70a39f 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ }, "main": "index.js", "scripts": { - "test": "jest" + "test": "mocha --compilers js:babel-core/register --require react-native-mock/mock", + "test:watch": "npm run test -- --watch" }, "keywords": [ "react-native", @@ -43,6 +44,7 @@ "babel-core": "^6.7.0", "babel-preset-es2015": "^6.6.0", "babel-preset-react": "^6.5.0", + "babel-preset-react-native": "^1.5.6", "babel-preset-stage-0": "^6.5.0", "chai": "^3.5.0", "chai-as-promised": "^5.2.0", diff --git a/test/Actions.test.js b/test/Actions.test.js index 6bc54214e..453c2553a 100644 --- a/test/Actions.test.js +++ b/test/Actions.test.js @@ -56,16 +56,16 @@ describe('Actions', () => { Actions.callback = scene=>state = reducer(state, scene); expect(state).equal(undefined); Actions.init(); - expect(state.key).equal("modal"); + expect(state.key).equal("0_modal"); Actions.messaging(); - expect(state.scenes.current).equal("messaging"); + expect(currentScene.key).equal("messaging"); //Actions.pop(); Actions.login(); - expect(state.children[1].key).equal("login"); + expect(state.children[1].key).equal("1_login"); expect(state.children[1].children.length).equal(1); - expect(state.children[1].children[0].key).equal("loginModal1"); + expect(state.children[1].children[0].key).equal("0_loginModal1"); }); -}); \ No newline at end of file +});