Skip to content

Commit

Permalink
Upgrade babel and jest
Browse files Browse the repository at this point in the history
  • Loading branch information
brysgo committed Mar 26, 2016
1 parent c590c69 commit db2d91f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015", "stage-0"]
}
3 changes: 1 addition & 2 deletions config/env.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import regeneratorRuntime from 'babel-runtime/regenerator';
global.regeneratorRuntime = regeneratorRuntime;
import "babel-polyfill";

global.knex = require('../connection').knex;
8 changes: 2 additions & 6 deletions config/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function clean() {
export function clean() {
return [
'students',
'classrooms',
Expand All @@ -8,8 +8,4 @@ function clean() {
].reduce((promise, table) =>
promise.then(knex(table).delete('*'))
, Promise.resolve());
}

export default {
clean
}
}
3 changes: 2 additions & 1 deletion models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import Homework from './Homework'
import Student from './Student'
import Subject from './Subject'

export default { Classroom, Homework, Student, Subject }

module.exports = { Classroom, Homework, Student, Subject }
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Some help defining schema around bookshelfjs models.",
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/jest -b",
"test": "./node_modules/.bin/jest -b --runInBand",
"build": "./node_modules/.bin/babel src/index.js > index.js",
"pretest": "npm run-script build",
"prepublish": "npm run-script build"
Expand All @@ -27,22 +27,26 @@
},
"homepage": "https://github.com/brysgo/graphql-bookshelf#readme",
"devDependencies": {
"babel": "^5.8.21",
"babel-jest": "^5.3.0",
"babel-runtime": "^5.8.20",
"babel-cli": "^6.6.5",
"babel-jest": "^9.0.3",
"babel-polyfill": "^6.7.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-0": "^6.5.0",
"bookshelf": "^0.8.1",
"co": "^4.6.0",
"graphql": "^0.4.9",
"jest-cli": "facebook/jest",
"jest-cli": "^0.9.2",
"knex": "^0.8.6",
"sqlite3": "^3.0.10"
},
"jest": {
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
"unmockedModulePathPatterns": [
".*"
],
"testDirectoryName": "specs",
"testPathDirs": [
"<rootDir>/specs"
],
"setupEnvScriptFile": "<rootDir>/config/env.js",
"setupTestFrameworkScriptFile": "<rootDir>/config/setup.js"
},
Expand Down

0 comments on commit db2d91f

Please sign in to comment.