How to use assertive - 10 common examples

To help you get started, we’ve selected a few assertive 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 jarrodldavis / probot-gpg / test / gpg-context.js View on Github external
it('should assign base context properties to itself', () => {
    // Arrange
    const context = new ContextMock(createPayload(createSha(), createSha(), {
      action: 'synchronize',
      repoName: 'jarrodldavis/probot-gpg-test',
      number: 1
    }), 'pull_request', uuid())

    // Act
    const gpgContext = new GpgEventContext(createLogStubs(), context)

    // Assert
    assert.equal(context.payload, gpgContext.payload)
    assert.equal(context.github, gpgContext.github)
  })
github jarrodldavis / probot-gpg / test / plugin.js View on Github external
it('should throw if `acceptEvent` is called with incorrect execution context', async () => {
    // Arrange
    const { plugin, robotMock, contextMock } = arrange(sinon.stub())

    plugin.on('error', sinon.stub())

    plugin.load(robotMock)

    // Act, Assert
    const err = await assert.rejects(plugin.acceptEvent.call(undefined, contextMock))
    assert.equal('Unexpected execution context for method call', err.message)
  })
})
github jarrodldavis / probot-gpg / test / reduce-statuses.js View on Github external
it('should return "failure" if a middle status is a failure', () => {
    // Arrange
    const statusChain = ['success', 'success', 'failure', 'success', 'success'];

    // Act
    const actual = reduceStatuses(contextMock, statusChain);

    // Assert
    assert.equal('failure', actual);
  });
github jarrodldavis / probot-gpg / test / validate-commit.js View on Github external
it('should return "failure" if commit is not verified', () => {
    // Arrange
    const commit = createCommit('failure');

    // Act
    const actual = validateCommit(contextMock, commit);

    // Assert
    assert.equal('failure', actual);
  });
github jarrodldavis / probot-gpg / test / validate-commit.js View on Github external
it('should return "success" if commit is verified', () => {
    // Arrange
    const commit = createCommit('success');

    // Act
    const actual = validateCommit(contextMock, commit);

    // Assert
    assert.equal('success', actual);
  });
github jarrodldavis / probot-gpg / test / plugin.js View on Github external
it('should throw if `acceptEvent` is called with incorrect execution context', async () => {
    // Arrange
    const { plugin, robotMock, contextMock } = arrange(sinon.stub())

    plugin.on('error', sinon.stub())

    plugin.load(robotMock)

    // Act, Assert
    const err = await assert.rejects(plugin.acceptEvent.call(undefined, contextMock))
    assert.equal('Unexpected execution context for method call', err.message)
  })
})
github jarrodldavis / probot-gpg / test / plugin.js View on Github external
it('should throw if `load` is called with incorrect execution context', () => {
    // Arrange
    const { plugin, robotMock } = arrange(sinon.stub())

    // Act, Assert
    const err = assert.throws(() => plugin.load.call(undefined, robotMock))
    assert.equal('Unexpected execution context for method call', err.message)
  })
github buggerjs / bugger-daemon / test / unit / page / model.js View on Github external
it('parses script', function() {
        assert.equal('example/ok.js', this.page.script);
      });
github jarrodldavis / probot-gpg / test / validate-gpg.js View on Github external
it('should return "failure" if one, but not all, of the commits has an invalid GPG signature', async () => {
    return assert.equal('failure', await testScenario('success', 'failure', 'success'));
  });
github jarrodldavis / probot-gpg / test / validate-gpg.js View on Github external
it('should return "success" if all of the commits have a verified GPG signature', async () => {
    return assert.equal('success', await testScenario('success', 'success', 'success'));
  });

assertive

Assertive is a terse yet expressive assertion library

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

49 / 100
Full package analysis