Skip to content

Commit 273c693

Browse files
committed
Fix failing tests in Node v8.0.0
1 parent a4dd61b commit 273c693

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

test/unit/login-consent-request.js

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,11 @@ describe('LoginConsentRequest', () => {
194194
req = { body: { scope: 'openid', client_id: clientId } }
195195
res = HttpMocks.createResponse()
196196
opAuthRequest = createOpAuthRequest({ res, host })
197-
opAuthRequest = {
198-
...opAuthRequest,
199-
req: {
200-
...opAuthRequest.req,
197+
opAuthRequest = Object.assign(opAuthRequest, {
198+
req: Object.assign(opAuthRequest.req, {
201199
body: req.body
202-
}
203-
}
200+
})
201+
})
204202
})
205203

206204
it('should mark successful consent automatically', () => {
@@ -234,13 +232,11 @@ describe('LoginConsentRequest', () => {
234232
req = { body: { consent: true, scope: 'openid', client_id: clientId } }
235233
res = HttpMocks.createResponse()
236234
opAuthRequest = createOpAuthRequest({ res, host })
237-
opAuthRequest = {
238-
...opAuthRequest,
239-
req: {
240-
...opAuthRequest.req,
235+
opAuthRequest = Object.assign(opAuthRequest, {
236+
req: Object.assign(opAuthRequest.req, {
241237
body: req.body
242-
}
243-
}
238+
})
239+
})
244240
})
245241

246242
it('should call saveConsentForClient()', () => {
@@ -290,16 +286,14 @@ describe('LoginConsentRequest', () => {
290286
req = { body: { scope: 'openid' } }
291287
res = HttpMocks.createResponse()
292288
opAuthRequest = createOpAuthRequest({ res })
293-
opAuthRequest = {
294-
...opAuthRequest,
295-
req: {
296-
...opAuthRequest.req,
297-
body: req.body,
289+
opAuthRequest = Object.assign(opAuthRequest, {
290+
req: Object.assign(opAuthRequest.req, {
298291
session: {
299292
consentedOrigins: []
300-
}
301-
}
302-
}
293+
},
294+
body: req.body
295+
})
296+
})
303297
})
304298

305299
describe('if user consent has been previously saved', () => {
@@ -363,15 +357,13 @@ describe('LoginConsentRequest', () => {
363357
let redirect = sinon.stub(res, 'redirect')
364358

365359
let opAuthRequest = createOpAuthRequest({ res })
366-
opAuthRequest = {
367-
...opAuthRequest,
368-
req: {
369-
...opAuthRequest.req,
360+
opAuthRequest = Object.assign(opAuthRequest, {
361+
req: Object.assign(opAuthRequest.req, {
370362
session: {
371363
consentedOrigins: []
372364
}
373-
}
374-
}
365+
})
366+
})
375367
let request = LoginConsentRequest.from(opAuthRequest)
376368

377369
return LoginConsentRequest.obtainConsent(request)

0 commit comments

Comments
 (0)