Skip to content

Commit

Permalink
add support for babel in tests in non-intrusive manner
Browse files Browse the repository at this point in the history
  • Loading branch information
kkemple committed May 25, 2017
1 parent 699c706 commit 409bbde
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["transform-es2015-modules-commonjs"]
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "src/index.js",
"description": "React Native Calendar Components",
"scripts": {
"test": "jasmine src/*.spec.js && npm run lint",
"test": "babel-node spec/runner.js && npm run lint",
"lint": "eslint src/ example/src"
},
"repository": {
Expand All @@ -24,7 +24,9 @@
"react-native": "0.44.0"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-eslint": "^7.2.3",
"babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
"eslint": "^3.19.0",
"eslint-plugin-react": "^7.0.0",
"jasmine": "^2.5.2",
Expand Down
6 changes: 6 additions & 0 deletions spec/runner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Jasmine from 'jasmine';
import path from 'path';

var jasmine = new Jasmine();
jasmine.loadConfigFile(path.resolve(__dirname, 'support', 'jasmine.json'));
jasmine.execute();
8 changes: 8 additions & 0 deletions spec/support/jasmine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"spec_dir": "src",
"spec_files": [
"*.spec.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}

0 comments on commit 409bbde

Please sign in to comment.