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(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) {