Описание тега vows
Asynchronous behaviour driven development for Node.
Asynchronous tests are first class citizens in vows:
// connection-test.js
var vows = require('vows'),
assert = require('assert');
// Create a Test Suite
vows.describe('connection api').addBatch({
'when connecting': {
topic: function () {
var self = this;
socket.connect(/* ... */);
socket.on('connect', function(){
self.callback(this);
});
},
'a bidirectional channel is open': function (socket) {
assert.isNotNull(socket);
socket.send('hello');
}
}
}).run(); // Run it
Run the tests:
vows test/connection-test.js --spec
See http://vowsjs.org/ for documentation and examples.