Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should validate a header (failure case)', () => {
const m = H.decodeHeader('token', t.string.decode)
const c = new MockConnection(new MockRequest({}, undefined, undefined, {}))
return assertFailure(m, c, errors => {
assert.deepStrictEqual(failure(errors), ['Invalid value undefined supplied to : string'])
})
})
})
it('should validate a header (success case)', () => {
const m = H.decodeHeader('token', t.string.decode)
const c = new MockConnection(
new MockRequest({}, undefined, undefined, { token: 'mytoken' }),
)
return assertSuccess(m, c, 'mytoken', [])
})