1.4.0 • Published 9 years ago

claim v1.4.0

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

claim Build Status

Tiny assertion library

Install

$ npm install --save claim

Usage

var claim = require('claim');

claim.true(true);
claim.false(false);
claim.is('foo', 'foo');
claim.not('foo', 'bar');
claim.same(['a', 'b'], ['a', 'b']);
claim.notSame({a: 'a'}, {a: 'b'});
claim.regexTest(/^abc$/, 'abc');

API

.pass(message)

Passing assertion.

.fail(message)

Failing assertion.

.ok(value, message)

Assert that value is truthy.

.notOk(value, message)

Assert that value is falsy.

.true(value, message)

Assert that value is true.

.false(value, message)

Assert that value is false.

.is(value, expected, message)

Assert that value is equal to expected.

.not(value, expected, message)

Assert that value is not equal to expected.

.same(value, expected, message)

Assert that value is deep equal to expected.

.notSame(value, expected, message)

Assert that value is not deep equal to expected.

.throws(function, error, message)

Assert that function throws an error.

error can be a constructor, regex or validation function.

.doesNotThrow(function, message)

Assert that function doesn't throw an error.

.regexTest(regex, contents, message)

Assert that regex matches contents.

.ifError(error, message)

Assert that error is falsy.

License

MIT © Kevin Mårtensson

1.4.0

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago