@fluffy-spoon/substitute
Advanced tools
Comparing version 1.0.51 to 1.0.52
{ | ||
"name": "@fluffy-spoon/substitute", | ||
"version": "1.0.51", | ||
"version": "1.0.52", | ||
"description": "An NSubstitute port to TypeScript called substitute.js.", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/Index.js", |
@@ -61,2 +61,9 @@ [`@fluffy-spoon/substitute`](https://www.npmjs.com/package/@fluffy-spoon/substitute) is a TypeScript port of [NSubstitute](http://nsubstitute.github.io), which aims to provide a much more fluent mocking opportunity for strong-typed languages. | ||
calculator.received().add(1, Arg.is(x => x < 0)); | ||
``` | ||
``` | ||
# Benefits over other mocking libraries | ||
- Easier-to-understand fluent syntax. | ||
- No need to cast to `any` in certain places (for instance, when overriding read-only properties) due to the `myProperty.returns(...)` syntax. | ||
- Doesn't weigh much. | ||
- Produces very clean and descriptive error messages. Try it out - you'll love it. | ||
- Doesn't rely on object instances - you can produce a strong-typed fake from nothing, ensuring that everything is mocked. |
92714
69