(from here)
var nock = require('nock');
var couchdb = nock('https://kikoo.js')
.get('/users/1')
.reply(200, {
_id: '123ABC',
_rev: '946B7D1C',
username: 'toto',
email: 'toto2015@kikoo.js'
});
var scope = nock('https://kikoo.js')
.post('/users', {
username: 'toto',
email: 'toto2015@kikoo.js'
})
.reply(201, {
ok: true,
id: '123ABC',
rev: '946B7D1C'
});
var scope = nock('https://kikoojs.com', {allowUnmocked: true});
nock('https://kikoo.js').get('/').times(4).reply(200, 'Ok');
DEBUG=nock.*
nock.recorder.rec();
(from https://cucumber.io)
1: Feature: Some terse yet descriptive text of what is desired
2: Textual description of the business value of this feature
3: Business rules that govern the scope of the feature
4: Any additional information that will make the feature easier to understand
5:
6: Scenario: Some determinable business situation
7: Given some precondition
8: And some other precondition
9: When some action by the actor
10: And some other action
11: And yet another action
12: Then some testable outcome is achieved
13: And something else we can check happens too
14:
15: Scenario: A different situation
16: ...
this.Then(/^I should see "(.*)" as the page title$/, function (title, callback) { ...
this.Then('I should see "$title" as the page title', function (title, callback) { ...