Skip to content

Commit

Permalink
Add original version to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nalanj committed Dec 10, 2024
1 parent e07d24f commit 846b4b5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Example:
const mockableThing = mockable(thing);
```

*Added in v1.0.0*

### disableMockable()

Disables the library in the given environment. You'll want to call this as early
Expand All @@ -64,6 +66,8 @@ Example:
disableMockable();
```

*Added in v1.0.0*

### .override(t, fn)

Override a mockable within test context `t`. Returns `fn` wrapped as a `mock.fn`. Clears the mock automatically when the test context ends.
Expand All @@ -82,6 +86,8 @@ test("a test", (t) => {
});
```

*Added in v1.0.0*

## Assertions

All of the assertions provided by this package are for asserting against Node's
Expand All @@ -108,6 +114,8 @@ test("a test", (t) => {
});
```

*Added in v1.0.0*

### assert.calledOnce(mockFn)

Assert that `mockFn` has been called exactly once.
Expand All @@ -123,6 +131,8 @@ test("a test", (t) => {
assert.calledOnce(mockFn);
});
```
*Added in v1.0.0*

### assert.calledOnce(mockFn)

Assert that `mockFn` has been called exactly once.
Expand All @@ -139,6 +149,7 @@ test("a test", (t) => {
});
```

*Added in v1.0.0*

### assert.calledOnce(mockFn)

Expand All @@ -156,6 +167,8 @@ test("a test", (t) => {
});
```

*Added in v1.0.0*

### assert.calledTimes(mockFn, count)

Assert that `mockFn` has been called exactly `count` times.
Expand All @@ -172,6 +185,8 @@ test("a test", (t) => {
});
```

*Added in v1.0.0*

### assert.calledWith(mockFn, ...args)

Assert that `mockFn` has been called at least once with the given `args`
Expand All @@ -188,6 +203,8 @@ test("a test", (t) => {
});
```

*Added in v1.0.0*

## License

This code is licensed under the MIT license. See LICENSE for more information.

0 comments on commit 846b4b5

Please sign in to comment.