Running json-server and protractor test for both Windows and Linux

I would like to run json-serverand then test protractoron Windows and Linux. I currently have two configurations: one for Linux and one for Windows. Relevant part of packages.json:

"scripts": {
    "start": "json-server --watch testdb.json --static ./src",
    "e2e-win": "npm run protractor",
    "e2e-linux": "npm run protractor",
    "pree2e-win": "start /b npm start",
    "pree2e-linux": "npm start &",
    ...
}

json-serverstarts as a background process and then runs protractor. Is there any way to do this in OS agnostic mode? I just want one goal e2e.

+4
source share
1 answer

, concurrently , , package.json scripts ( , ):

"ng": "ng",
"serve": "ng serve --proxy-conf proxy.conf.json",
"api": "json-server --watch api/data.json --routes api/routes.json",
"start_custom": "concurrently \"npm run api \" \"npm run serve\""

, npm run start_custom

0

Source: https://habr.com/ru/post/1611554/


All Articles