This is a SuperTest demo with Grunt for API testing.
- A method about get
- Verify the response code:https://github.com/aimer1124/SuperTestDemo
- Use grunt to control the command
npm install
grunt
➜ SuperTestWithGrunt git:(master) ✗ grunt
Running "mochaTest:test" (mochaTest) task
Test Demo.
✓ Visit master (1640ms)
1 passing (2s)
Done, without errors.
- Default is master
- Switch ENV to
branch
- type command in command line
export NODE_ENV=branch
- use
grunt
➜ SuperTestWithGrunt git:(master) export NODE_ENV=branch
➜ SuperTestWithGrunt git:(master) grunt
Running "mochaTest:test" (mochaTest) task
Test Demo.
✓ Visit branch (1485ms)
1 passing (1s)
Done, without errors.