Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.spread((res, body) => {
assert.equal(res.statusCode, 200)
var json = JSON.parse(body)
assert.deepEqual(Object.keys(json), ['version', 'commit', 'source'])
assert.equal(json.version, require('../../package.json').version, 'package version')
assert.ok(json.source && json.source !== 'unknown', 'source repository')
// check that the git hash just looks like a hash
assert.ok(json.commit.match(/^[0-9a-f]{40}$/), 'The git hash actually looks like one')
})
}
return request(config.publicUrl + route).spread((res, body) => {
var json = JSON.parse(body)
assert.deepEqual(Object.keys(json), ['version', 'commit', 'source'])
assert.equal(json.version, require('../../package.json').version, 'package version')
assert.ok(json.source && json.source !== 'unknown', 'source repository')
// check that the git hash just looks like a hash
assert.ok(json.commit.match(/^[0-9a-f]{40}$/), 'The git hash actually looks like one')
})
}
}).then((status) => {
assert.equal(status.verified, false, 'email status now reports unverified, because mustVerify=true')
// The reauth should have triggerd a verification email.
return server.mailbox.waitForCode(email)
}).then((code) => {
return client.verifyEmail(code)
function (status) {
// Verify correct status
assert.equal(status.verified, false, 'account is unverified')
assert.equal(status.emailVerified, true, 'account email is verified')
assert.equal(status.sessionVerified, false, 'account session is unverified')
}
)
it('should have a chainable tap function that passes the value to a function', function () {
var chain = shackles()
var myval = null
var result = chain(10)
.tap(function(value) {
myval = value * 2
})
.value()
assert.equal(result, 10)
assert.equal(myval, 20)
})
it('should override the boxed value with the value that the tap callback returns', function () {
var chain = shackles()
var result = chain(10)
.tap(function(value) {
return value/2
})
.value()
assert.equal(result, 5)
})
})
it('should override the boxed value with any scalar properties that are called as chained functions', function () {
var chain = shackles({
num: 10
})
var result = chain('dummy')
.num()
.value()
assert.equal(result, 10)
})
}).then(res => {
code = res.result.code;
assert.ok(code, 'an authorization code was generated');
return Server.api.delete({
url: '/client-tokens/' + clientId.toString('hex'),
headers: {
authorization: 'Bearer ' + tokenWithClientWrite
}
});
}).then(res => {
return Server.api.post({
function (x) {
assert.equal(x.tries, 3, 'three tries remaining')
assert.ok(x.ttl > 0 && x.ttl <= (60 * 60), 'ttl is ok')
}
)
function (reminders) {
var reminderFound = false
reminders.some(function (reminder) {
if (reminder.uid === accountData.uid.toString('hex')) {
reminderFound = true
return true
}
})
assert.ok(reminderFound, 'fetched the created reminder')
},
function (err) {