Version 2.0.0
Note
This version contains various breaking changes.
- For consistency, the
expect()
method now always returns a promise. Because of this, theasync()
method has been removed. Micro Test-Runner now gracefully handles both sync and async candidates automatically. - Logs are now much clearer, and include the expected vs received result when a test fails.
- The
logging()
method now accepts string options forseverity
andperformance
. You no longer need to importFailureLogSeverity
if you want to use automatic error logging. For example:.logging('Awesome', 'error', ['✓', '✕'], 'table')
- The
with()
method now accepts a simple list of arguments, instead of an array. For example:.with(foo, 'bar', 'baz')
- This is the same for the
expect()
method:.expect(foo, 5, (value) => value + 1 === 7)
- Type hints for arguments and results have been added. TypeScript will now inform you of any type mismatches between
test()
,with()
, andexpect()
. For example:function isEven(a: number): boolean { return a % 2 === 0; } test(isEven) .with('foo') // TS: ^ Argument of type 'string' is not assignable to parameter of type 'number'. .expect(24) // TS: ^ Argument of type 'number' is not assignable to parameter of type 'boolean'.