Skip to content

Commit

Permalink
wallaby + jest support
Browse files Browse the repository at this point in the history
  • Loading branch information
artald committed Mar 7, 2017
1 parent 131d9e0 commit 76e18e0
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 4 deletions.
22 changes: 18 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"react-native": "^0.38.0",
"react-native-blur": "~1.0.0",
"react-native-autogrow-textinput": "^3.0.0",
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.1",
"jest": "^18.1.0",
"babel-jest": "^18.0.0",
"eslint": "^3.0.0",
"eslint-config-airbnb": "^14.0.0",
"eslint-plugin-import": "^2.2.0",
Expand All @@ -53,9 +53,23 @@
"eslint-plugin-react-native": "^2.0.0"
},
"jest": {
"preset": "react-native"
"preset": "react-native",
"testPathIgnorePatterns": [
"/e2e/",
"/ios/",
"/android/",
"/node_modules/"
],
"testRegex": "(/__tests__/.*|(\\.|/)(spec|test))\\.js?$"
},
"babel": {
"presets": ["react-native"]
"env": {
"test": {
"presets": [
"react-native"
],
"retainLines": true
}
}
}
}
33 changes: 33 additions & 0 deletions wallaby.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*eslint-disable*/
'use strict';
process.env.BABEL_ENV = 'test';
const babelOptions = require('./package.json').babel.env.test;
module.exports = function(wallaby) {
return {
env: {
type: 'node',
runner: 'node'
},

testFramework: 'jest',

files: [
'package.json',
'src/**/*.js',
'!src/**/*.spec.js'
],

tests: [
'src/**/*.spec.js'
],

compilers: {
'**/*.js': wallaby.compilers.babel(babelOptions)
},

setup: function(w) {
require('babel-polyfill');
w.testFramework.configure(require('./package.json').jest);
}
};
};

0 comments on commit 76e18e0

Please sign in to comment.