v2.0.0
Compatibility
- Requires Deno v1.20 or higher
Documentation
Usage
- Create a
deps.ts
file.
// deps.ts
export { Dummy, Fake, Mock, Stub } from "https://deno.land/x/[email protected]/mod.ts";
- 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