How to use the insist.ok function in insist

To help you get started, we’ve selected a few insist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / fxa-auth-server / test / remote / base_path_tests.js View on Github external
.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')
        })
    }
github mozilla / fxa-auth-server / test / remote / misc_tests.js View on Github external
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')
      })
    }
github mozilla / fxa-oauth-server / test / api.js View on Github external
}).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({
github mozilla / fxa-auth-server / test / remote / password_forgot_tests.js View on Github external
function (x) {
                  assert.equal(x.tries, 3, 'three tries remaining')
                  assert.ok(x.ttl > 0 && x.ttl <= (60 * 60), 'ttl is ok')
                }
              )
github mozilla / fxa-auth-server / test / remote / mailer_reminder_db_tests.js View on Github external
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) {

insist

Drop-in replacement of assert with a better message.

MPL-2.0
Latest version published 7 years ago

Package Health Score

42 / 100
Full package analysis

Popular insist functions