Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 5805cef

Browse files
committed
Merge tag 'v0.0.3'
0.0.3
2 parents f755340 + d10a03d commit 5805cef

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ _beforeEach.givenModel = function(modelName, attrs, optionalHandler) {
111111

112112
model.create(attrs, function(err, result) {
113113
if(err) {
114+
console.error(err.message);
115+
if(err.details) console.error(err.details);
114116
done(err);
115117
} else {
116118
test[modelKey] = result;
@@ -168,6 +170,7 @@ _describe.whenCalledRemotely = function(verb, url, cb) {
168170
if(typeof url === 'function') {
169171
urlStr = '/<dynamic>';
170172
}
173+
171174
describe(verb.toUpperCase() + ' ' + urlStr, function() {
172175
beforeEach(function(cb) {
173176
if(typeof url === 'function') {
@@ -188,7 +191,9 @@ _describe.whenCalledRemotely = function(verb, url, cb) {
188191
this.req = this.http.req;
189192
var test = this;
190193
this.http.end(function(err) {
194+
test.req = test.http.req;
191195
test.res = test.http.res;
196+
test.url = undefined;
192197
cb();
193198
});
194199
});
@@ -236,7 +241,8 @@ _it.shouldBeAllowed = function() {
236241
_it.shouldBeDenied = function() {
237242
it('should not be allowed', function() {
238243
assert(this.res);
239-
assert.equal(this.res.statusCode, 401);
244+
var status = this.res.statusCode;
245+
assert(status === 401 || status === 404);
240246
});
241247
}
242248

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loopback-testing",
3-
"version": "0.0.1",
3+
"version": "0.0.3",
44
"description": "Utilities for testing LoopBack applications",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)