Replace node with babel-node

This should ensure that you don't have to reubild the server all the
time
This commit is contained in:
Robert Schäfer 2019-01-17 15:23:24 +01:00
parent 9e4edca35b
commit d50015af3c
3 changed files with 3 additions and 11 deletions

View File

@ -137,15 +137,7 @@ npm run db:reset
**Beware**: We have no multiple database setup at the moment. We clean the database after each test, running the tests will wipe out all your data!
First build `server.js`:
```bash
yarn run build
# -or-
npm run build
```
The additional build step will become obsolete, as soon as [jest transforms global setup teardown modules](https://github.com/facebook/jest/issues/5164).
Now run the tests:
Run the tests:
```bash
yarn run test
# -or-

0
dist/.gitkeep vendored
View File

View File

@ -5,14 +5,14 @@ let server
let seeder
const setup = async function () {
server = spawn('node', ['dist/'], {
server = spawn('babel-node', ['src/index'], {
env: Object.assign({}, process.env, {
GRAPHQL_URI: 'http://localhost:4123',
GRAPHQL_PORT: '4123'
})
})
seeder = spawn('node', ['dist/'], {
seeder = spawn('babel-node', ['src/index'], {
env: Object.assign({}, process.env, {
GRAPHQL_URI: 'http://localhost:4001',
GRAPHQL_PORT: '4001',