npm - Automate Functional Testing in node.js -


i checked npm libraries test webpages or web-services. of them expect server running. since want automate functional testing, how can setup npm package in such way that

  1. it can start server
  2. test application
  3. stop server

so can test locally, on online ci tools travis-ci or circleci.

case 1: webservice

i wrote npm package starts nodejs http(s) server. can started command line $stubmatic. currently, use 2 approaches test it,

  1. manual : manually start command line. run tests.
  2. automatic: use exec module run unix command can start application , run pkill command kill application. automation, application need installed on testing machine.

case 2: website

i have create npm package: fast-xml-parser , created demo page within repo can tested in browser. test demo page, start local server using http-server npm package manually. test application.

what can better way write automate functional tests node js applications?

note:

  • i never used task runners gulp or grunt. i'm not sure if can in case.
  • in case 1, application starts node js native http server. i'm not using 3rd party application express currently.

this question mentions new docker container system travis duplicated locally. might way: how run travis-ci locally


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -