Stubmatic | Mock HTTP calls without coding. Designed specially | Mock library
kandi X-RAY | Stubmatic Summary
kandi X-RAY | Stubmatic Summary
Mock HTTP calls without coding. Designed specially for testing and testers. Important links : Video Tutorial, Wiki, NPM, Demo application, issues, changelogs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get a key from a table .
- Determines whether an expression matches the expression
Stubmatic Key Features
Stubmatic Examples and Code Snippets
Community Discussions
Trending Discussions on Stubmatic
QUESTION
I checked some NPM libraries to test a webpages or web-services. But all of them expect that the server is already running. Since I want to automate functional testing, how can I setup NPM package in such a way that
- It can start the server
- Test the application
- Stop the server
So that I can test it locally, as well as on online CI tools like travis-ci or circleci.
Case 1: Webservice
I wrote a NPM package which starts nodejs HTTP(s) server. It can be started from command line $stubmatic
. Currently, I use 2 approaches to test it,
- manual : I manually start it from command line. Then run the tests.
- Automatic: I use
exec
module to run a unix command which can start the application and runpkill
command to kill the application. But for this automation, my application need to be installed on testing machine.
Case 2: Website
I have create a NPM package: fast-xml-parser
and created a demo page within the repo so that I can be tested in the browser. To test the demo page, I currently start a local server using http-server
npm package manually. Test the application.
What can be the better way to write automate functional tests for node js applications?
Note:
- I never used task runners like gulp or grunt. So I'm not sure if they can help in this case.
- In case 1, my application starts node js native HTTP server. I'm not using any 3rd party application like
express
currently.
ANSWER
Answered 2017-Jan-30 at 10:49This question mentions a new Docker container system for Travis that could be duplicated locally. It might be a way: How to run travis-ci locally
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Stubmatic
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page