How to use the assertthat.assert.that function in assertthat

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 / flaschenpost / test / unit / ConfigurationTests.ts View on Github external
test('returns a clone of the configuration with a new application.', async (): Promise => {
      const newApplication = {
        name: 'new-application',
        version: '13.3.7'
      };
      const newConfiguration = defaultConfiguration.withApplication(newApplication);

      assert.that(newConfiguration).is.not.sameAs(defaultConfiguration);
      assert.that(newConfiguration.application).is.sameAs(newApplication);
      assert.that(newConfiguration.debugModuleFilter).is.equalTo(defaultConfiguration.debugModuleFilter);
      assert.that(newConfiguration.formatter).is.equalTo(defaultConfiguration.formatter);
      assert.that(newConfiguration.highestEnabledLogLevel).is.equalTo(defaultConfiguration.highestEnabledLogLevel);
      assert.that(newConfiguration.hostname).is.equalTo(defaultConfiguration.hostname);
      assert.that(newConfiguration.logEntryIdGenerator).is.equalTo(defaultConfiguration.logEntryIdGenerator);
    });
  });
github thenativeweb / flaschenpost / test / unit / formatters / asJsonTests.ts View on Github external
test('is a function.', async (): Promise => {
    assert.that(asJson).is.ofType('function');
  });
github thenativeweb / flaschenpost / test / unit / ConfigurationTests.ts View on Github external
test('returns a clone of the configuration with a new application.', async (): Promise => {
      const newApplication = {
        name: 'new-application',
        version: '13.3.7'
      };
      const newConfiguration = defaultConfiguration.withApplication(newApplication);

      assert.that(newConfiguration).is.not.sameAs(defaultConfiguration);
      assert.that(newConfiguration.application).is.sameAs(newApplication);
      assert.that(newConfiguration.debugModuleFilter).is.equalTo(defaultConfiguration.debugModuleFilter);
      assert.that(newConfiguration.formatter).is.equalTo(defaultConfiguration.formatter);
      assert.that(newConfiguration.highestEnabledLogLevel).is.equalTo(defaultConfiguration.highestEnabledLogLevel);
      assert.that(newConfiguration.hostname).is.equalTo(defaultConfiguration.hostname);
      assert.that(newConfiguration.logEntryIdGenerator).is.equalTo(defaultConfiguration.logEntryIdGenerator);
    });
  });
github thenativeweb / flaschenpost / test / unit / readPackageJsonTests.ts View on Github external
test('is a function.', async (): Promise => {
    assert.that(readPackageJson).is.ofType('function');
  });
github thenativeweb / flaschenpost / test / unit / readPackageJsonTests.ts View on Github external
test('returns unknown as name and version if no package.json exists in the given directory.', async (): Promise => {
    const directory = path.join(__dirname, '..', 'shared', 'packageJsonMissing');
    const packageJson = readPackageJson(directory);

    assert.that(packageJson).is.equalTo({
      name: '(unknown)',
      version: '(unknown)'
    });
  });

assertthat

assertthat provides fluent TDD.

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Popular assertthat functions