File tree 3 files changed +7057
-15372
lines changed
3 files changed +7057
-15372
lines changed Original file line number Diff line number Diff line change 1
1
const isPortReachable = require ( 'is-port-reachable' ) ;
2
2
const path = require ( 'path' ) ;
3
3
const dockerCompose = require ( 'docker-compose' ) ;
4
- const npm = require ( 'npm' ) ;
5
- const util = require ( 'util' ) ;
4
+ const { execSync } = require ( 'child_process' ) ;
6
5
7
6
module . exports = async ( ) => {
8
7
console . time ( 'global-setup' ) ;
@@ -25,12 +24,9 @@ module.exports = async () => {
25
24
) ;
26
25
27
26
// ️️️✅ Best Practice: Use npm script for data seeding and migrations
28
- const npmLoadAsPromise = util . promisify ( npm . load ) ;
29
- await npmLoadAsPromise ( ) ;
30
- const npmCommandAsPromise = util . promisify ( npm . commands . run ) ;
31
- await npmCommandAsPromise ( [ 'db:migrate' ] ) ;
27
+ execSync ( 'npm run db:migrate' ) ;
32
28
// ✅ Best Practice: Seed only metadata and not test record, read "Dealing with data" section for further information
33
- await npmCommandAsPromise ( [ ' db:seed'] ) ;
29
+ execSync ( 'npm run db:seed') ;
34
30
}
35
31
36
32
// 👍🏼 We're ready
You can’t perform that action at this time.
0 commit comments