You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed when writing controller tests for POST and PUT that nothing was passing because all the validators failed regardless of the payload I submit. I also did not see a way to override the headers. This led me to discover the following bug. When I get time I'll submit a patch:
EndpointReqeust.mock method passes Router.prepare an empty hash
Which makes the Router.parseBody in poly/fxn set contentType to be an empty string
An example of test that fails on the built-in User model and UserController:
'use strict';constNodal=require('nodal');classUserControllerTestextendsNodal.mocha.Test{test(expect){it('assert POST returns an HTTP 200',done=>{this.endpoint('/v1/users/').post({"email":"foobar@gmail.com","username":"foobar","password":"foobar"},(status,headers,body,json)=>{//console.log("[ JSON ]: ", json);expect(status).to.equal(200);done();});});};// test()}module.exports=UserControllerTest;
The text was updated successfully, but these errors were encountered:
I noticed when writing controller tests for
POST
andPUT
that nothing was passing because all the validators failed regardless of the payload I submit. I also did not see a way to override the headers. This led me to discover the following bug. When I get time I'll submit a patch:EndpointReqeust.mock
method passesRouter.prepare
an empty hashWhich makes the
Router.parseBody
inpoly/fxn
setcontentType
to be an empty stringAn example of test that fails on the built-in
User
model andUserController
:The text was updated successfully, but these errors were encountered: