Skip to content

v2.0.0

Compare
Choose a tag to compare
@drashbot drashbot released this 16 Apr 20:49
· 107 commits to main since this release
a5795f6

Compatibility

  • Requires Deno v1.20 or higher

Documentation

Usage

  1. Create a deps.ts file.
// deps.ts

export { Dummy, Fake, Mock, Stub } from "https://deno.land/x/[email protected]/mod.ts";
  1. Import the test doubles from your deps.ts file.
import { Dummy, Fake, Mock, Stub } from "./deps.ts"

... your
... code
... here

Release Summary

View the associated article for this release here.

  • BREAKING: remove test runner (Rhum.testPlan, Rhum.testSuite, Rhum.testCase, and hooks)
  • BREAKING: stub API (no need to stub a class to stub its members)
  • feat: add Fake()
  • feat: add Dummy()
  • feat: Add new methods to Mock()
    • expects(...).toBeCalled(...)
    • method(...).willReturn(...)
    • method(...).wilThrow(...)
    • verifyExpectations()
  • feat: pre-programmed method implementation for faking/mocking methods
    • this is used to help fakes take shortcuts
    • this is used to help mocks pre-program methods
  • feat: add interfaces so that they can be returned for improved type hinting
  • feat: build for cjs and es2015
  • refactor: mocks to use mixin (mocks are now extensions of the class they are mocking)
  • refactor: types are now stricter and provide better type hinting
  • test: move integration test files into unit tests
  • test: test fakes, dummies, mocks, and stubs