I have some custom testing script, which I can run with npm run test command, which executes some Node script for starting e2e/unit tests. But before it I must star
npm run test
You can use exec to run from script
import {series} from 'async'; const {exec} = require('child_process'); series([ () => exec('npm run dev'), () => exec('npm run test') ]);