How to use assertthat - 10 common examples

To help you get started, we’ve selected a few assertthat 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 thenativeweb / roboter / test / integration / release / adds-version-tag / expected.js View on Github external
const validate = async function ({ directory, repository }) {
  /* eslint-disable global-require */
  const packageJson = require(path.join(directory, 'package.json'));
  /* eslint-enable global-require */

  assert.that(packageJson.version).is.equalTo('1.0.0');

  const listTags = shell.ls(`${repository}/refs/tags`);

  const tags = listTags.stdout.split('\n');

  assert.that(tags[0]).is.equalTo('1.0.0');
};
github thenativeweb / flaschenpost / test / unit / flaschenpostTests.ts View on Github external
test('has configure and getLogger functions.', async (): Promise => {
    /* eslint-disable @typescript-eslint/unbound-method */
    assert.that(flaschenpost.configure).is.ofType('function');
    assert.that(flaschenpost.getLogger).is.ofType('function');
    /* eslint-enable @typescript-eslint/unbound-method */
  });
github thenativeweb / flaschenpost / test / unit / flaschenpostTests.ts View on Github external
test('has configure and getLogger functions.', async (): Promise => {
    /* eslint-disable @typescript-eslint/unbound-method */
    assert.that(flaschenpost.configure).is.ofType('function');
    assert.that(flaschenpost.getLogger).is.ofType('function');
    /* eslint-enable @typescript-eslint/unbound-method */
  });
github thenativeweb / roboter / test / integration / update / updates-even-if-not-on-master / expected.js View on Github external
const constraint = `>=${latestVersion} <${semver.inc(latestVersion, 'major')}`;

  /* eslint-disable global-require */
  const packageJson = await fs.readFile(path.join(directory, 'package.json'), { encoding: 'utf-8' });
  /* eslint-enable global-require */

  const newPackageJson = stripIndent`
  {
    "name": "test-package",
    "version": "0.0.1",
    "engines": {
      "node": "${constraint}"
    }
  }`;

  assert.that(packageJson).is.atLeast(`${newPackageJson}\n`);
};
github thenativeweb / roboter / test / integration / release / bumps-minor-version / expected.js View on Github external
const validate = async function ({ directory }) {
  /* eslint-disable global-require */
  const packageJson = require(path.join(directory, 'package.json'));
  /* eslint-enable global-require */

  assert.that(packageJson.version).is.equalTo('0.1.0');
};
github thenativeweb / p2p / test / PeerTests.js View on Github external
test('sets itself as its successor if the successors list only has one element.', done => {
        peer.setSuccessor({ host: 'example.com', port: 3000 });
        peer.successors = [{ host: 'foo.com', port: 3000 }];

        peer.fixSuccessor();

        assert.that(peer.successor).is.equalTo(peer.self);
        done();
      });
github thenativeweb / p2p / test / PeerTests.js View on Github external
test('initially contains information on the endpoint of the peer.', done => {
        assert.that(peer.predecessor).is.equalTo({
          host: 'localhost',
          port: 3000,
          id: sha1('localhost:3000')
        });
        done();
      });
    });
github thenativeweb / flaschenpost / test / integration / normalizeTests.js View on Github external
}, (code, stdout, stderr) => {
      assert.that(code).is.equalTo(0);

      const messages = stdout.split('\n').
        filter(line => line !== '').
        map(line => JSON.parse(line));

      assert.that(messages[0].level).is.equalTo('info');
      assert.that(messages[0].message).is.equalTo('Application started.');
      assert.that(messages[1].level).is.equalTo('error');
      assert.that(messages[1].message).is.equalTo('Something, somewhere went horribly wrong...');

      assert.that(stderr).is.equalTo('');
      done();
    });
  });
github thenativeweb / p2p / test / routes / handleTests.js View on Github external
test('is a function.', done => {
    assert.that(handle).is.ofType('function');
    done();
  });
github thenativeweb / p2p / test / p2pTests.js View on Github external
test('is an object.', done => {
    assert.that(p2p).is.ofType('object');
    done();
  });

assertthat

assertthat provides fluent TDD.

MIT
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis

Popular assertthat functions