Skip to content

Commit

Permalink
Remove bad example from Testing with Stubs documentation
Browse files Browse the repository at this point in the history
Remove an example from the Testing module involving `Throwscape` because
the way it's used is incorrect. In particular, `new Throwscape()` always
errors (as intended), so invoking it before calling `functionUnderTest`
is meaningless.
  • Loading branch information
ericcornelissen committed Nov 19, 2023
1 parent f9141fb commit ab349ba
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@ mocking ([for example with Jest][jest-module-mock]).
// my-module.test.js

import assert from "node:assert";
import { Shescape as Stubscape, Throwscape } from "shescape/testing";
import { Shescape as Stubscape } from "shescape/testing";
import { functionUnderTest } from "./my-module.js";

// Test good conditions
const stubscape = new Stubscape();
assert.ok(functionUnderTest(stubscape));

// Test bad conditions
const throwscape = new Throwscape();
assert.ok(functionUnderTest(throwscape));
```

### Why Stubs
Expand Down

0 comments on commit ab349ba

Please sign in to comment.