How to use the assertthat.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 / 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();
  });
github thenativeweb / flaschenpost / test / units / flaschenpostTests.js View on Github external
assert.that(paragraph).is.ofType('object');
          assert.that(paragraph.host).is.equalTo('example.com');
          assert.that(paragraph.pid).is.equalTo(process.pid);
          assert.that(paragraph.id).is.ofType('number');
          assert.that(paragraph.timestamp).is.not.undefined();
          assert.that(paragraph.level).is.equalTo('info');
          assert.that(paragraph.message).is.equalTo('App started.');
          assert.that(paragraph.application.name).is.equalTo('flaschenpost');
          assert.that(paragraph.application.version).is.not.undefined();
          assert.that(paragraph.module).is.equalTo({
            name: 'foo',
            version: '0.0.1'
          });
          assert.that(paragraph.source).is.equalTo(__filename);
          assert.that(paragraph.metadata).is.ofType('object');
          assert.that(paragraph.metadata.name).is.equalTo('Error');
          assert.that(paragraph.metadata.message).is.equalTo('Something went wrong.');
          done();
        });
github thenativeweb / flaschenpost / test / units / Middleware / indexTests.js View on Github external
letter.once('data', data => {
      assert.that(data.level).is.equalTo('info');
      assert.that(data.message).is.equalTo('foobar');
      assert.that(data.application.name).is.equalTo('flaschenpost');
      assert.that(data.application.version).is.not.undefined();
      assert.that(data.module).is.equalTo({
        name: 'foo',
        version: '0.0.1'
      });
      done();
    });
github thenativeweb / forcedomain / test / unit / rewriteTests.js View on Github external
], (url, expectedUrl, done) => {
      assert.that(rewrite(url, {
        hostname: 'www.thenativeweb.io'
      })).is.equalTo(expectedUrl);
      done();
    }));
github thenativeweb / flaschenpost / test / units / Middleware / indexTests.js View on Github external
letter.once('data', data => {
      assert.that(data.level).is.equalTo('info');
      assert.that(data.message).is.equalTo('foobar');
      assert.that(data.application.name).is.equalTo('flaschenpost');
      assert.that(data.application.version).is.not.undefined();
      assert.that(data.module).is.equalTo({
        name: 'foo',
        version: '0.0.1'
      });
      done();
    });
github thenativeweb / flaschenpost / test / units / flaschenpostTests.js View on Github external
letter.once('data', paragraph => {
          assert.that(paragraph).is.ofType('object');
          assert.that(paragraph.pid).is.equalTo(process.pid);
          assert.that(paragraph.id).is.ofType('number');
          assert.that(paragraph.timestamp).is.not.undefined();
          assert.that(paragraph.level).is.equalTo('info');
          assert.that(paragraph.message).is.equalTo('App started.');
          assert.that(paragraph.module).is.equalTo({
            name: 'foo',
            version: '0.0.1'
          });
          assert.that(paragraph.source).is.equalTo(__filename);
          assert.that(paragraph.metadata).is.equalTo({
            foo: 'bar',
            metadata: {
              bar: 'baz'
            }
          });
          done();
        });

assertthat

assertthat provides fluent TDD.

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Popular assertthat functions