#Introduction
In the previous posts “Testing Node applications with Intern framework” I demostrated how to set up testing environment for unit tests with Intern and Grunt and in “REST end to end testing Node applications with Intern framework” I demonstrated how to test REST endpoints with end to end tests in a speed of unit tests. Today I will show how to organize Quality Assurance environment for Unit, Integration and Functional tests.
#Grunt and task conventions
Here are tasks which we are using while testing:
test
- execute all tests (unit, integration, functional)testing
- as above in a watch loop, reexecutes tests when implementation or test sources changestest-unit
- execute unit teststesting-unit
- as above in a watch loop, reexecutes tests when implementation or test sources changestest-functional
- execute functionaltesting-functional
- as above in a watch loop, reexecutes tests when implementation or test sources changestest-integration
- execute integration teststesting-integration
- as above in a watch loop, reexecutes tests when implementation or test sources changes
Require
var suite = require('intern!object')
- require internal intern suite objectvar tester = require('../lib/restServerTester')
- require AMD styled filevar express = require('intern/dojo/node!express')
- require CommonJS modulevar swagger = require('intern/dojo/node!../../index')
- require custom CommonJS module from relative path