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
- it can start server
- test application
- 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,
- manual : manually start command line. run tests.
- automatic: use
exec
module run unix command can start application , runpkill
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
Post a Comment