How to use insist - 10 common examples

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-auth-server / test / remote / session_tests.js View on Github external
}).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)
github mozilla / fxa-auth-server / test / remote / password_change_tests.js View on Github external
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')
          }
        )
github raineorshine / shackles / test / spec.js View on Github external
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)
		})
github raineorshine / shackles / test / spec.js View on Github external
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)
		})
	})
github raineorshine / shackles / test / spec.js View on Github external
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)
	})
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 8 years ago

Package Health Score

42 / 100
Full package analysis

Popular insist functions