dimanche 10 janvier 2021

cypress - start server and test - run both http mock server and socket server on React application

I would like to run an integration test with msw + cypress + start-server-and-test

1- I have msw as a mock on the react app itself (port 3000) 2- I have a socket.io server in port 5000

my question is how to run it properly to make sure start-server-and-test will handle it I tried with concurrently. but I am not sure if this is the way

my package.json:

    "socket-server": "node test/socket/index.js"
    "start-server": "concurrently \"npm run socket-server\" \"cross-env NODE_ENV=development craco start\"",
    "test:e2e:ci": "start-server-and-test start-server \"3000\"  cypress:headless",

another issue is when I changed the port from 3000 to smth that unavailable the app stuck and the test does not close the app

thanks

Aucun commentaire:

Enregistrer un commentaire