You need to call the second test from an after
callback.
like so:
var frisby = require('./lib/frisby');
frisby.globalSetup({
request: {
headers: {
'Accept': 'application/json, application/x-httpd-php',
'Cookie': 'authenticationToken=5363; activationID=1'
}
},
timeout: (30 * 1000)
});
frisby.create(' ')
.get('http://xyz/auto?limit=0')
.expectStatus(200)
.expectHeaderContains('content-type', 'application/json')
.expectJSON('status', {
message: "SUCCESS",
code: 1
})
.after(function() {
frisby.create(' ')
.get('http://xyz/auto?limit=0')
.expectStatus(200)
.expectHeaderContains('content-type', 'application/json')
.expectJSON('status', {
message: "DATABASE_ERROR",
code: 2
})
.toss();
})
.toss();