Skip to content

Commit 329a40a

Browse files
add working returns example
1 parent cc5f11b commit 329a40a

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/index.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
import { Substitute, SubstituteOf } from './Substitute';
1+
import { Substitute, SubstituteOf } from './Substitute'
22

3-
export { Arg } from './Arguments';
4-
export { Substitute, SubstituteOf };
3+
export { Arg } from './Arguments'
4+
export { Substitute, SubstituteOf }
55

6-
export default Substitute;
6+
export default Substitute
7+
8+
interface Calc {
9+
version: number
10+
add(a: number, b: number): number
11+
}
12+
13+
const c = Substitute.for<Calc>()
14+
15+
c.add(2, 3).returns(5)
16+
console.log(c.add(2, 3))
17+
18+
c.version.returns(123)
19+
console.log(c.version)

0 commit comments

Comments
 (0)