Skip to content

Version 2.0.0

Compare
Choose a tag to compare
@Gigabyte5671 Gigabyte5671 released this 30 Oct 09:31
· 3 commits to main since this release

Note

This version contains various breaking changes.

  • For consistency, the expect() method now always returns a promise. Because of this, the async() 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 for severity and performance. You no longer need to import FailureLogSeverity 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(), and expect(). 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'.