Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

Commit

Permalink
feat: use nodemon with custom gateways
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanomackey committed May 14, 2019
1 parent 120f0b5 commit 9e3bdad
Show file tree
Hide file tree
Showing 4 changed files with 2,656 additions and 483 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"graphql-playground-middleware-express": "^1.3.8",
"mkdirp": "^0.5.1",
"node-cleanup": "^2.1.2",
"nodemon": "^1.19.0",
"yargs": "^10.0.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const startGateway = ({
: '';

// Start the user-specified gateway.
spawn('node', [gateway], { stdio: 'inherit' });
spawn('nodemon', ['-e', 'js,graphql', gateway], { stdio: 'inherit' });
return;
}

Expand Down
10 changes: 7 additions & 3 deletions test/dev.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,13 @@ describe('gramps dev', () => {

expect(process.env.GRAMPS_MODE).toEqual('live');
expect(process.env.GRAMPS_DATA_SOURCES).toEqual('');
expect(crossSpawn.spawn).toBeCalledWith('node', ['./gateway.js'], {
stdio: 'inherit',
});
expect(crossSpawn.spawn).toBeCalledWith(
'nodemon',
['-e', 'js,graphql', './gateway.js'],
{
stdio: 'inherit',
},
);
});

it('starts a custom gateway in mock mode when flag is set', async () => {
Expand Down
Loading

0 comments on commit 9e3bdad

Please sign in to comment.