Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shelly_goldblit committed Mar 15, 2024
1 parent 35c06db commit 517f40f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 110 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,34 @@ A generic stubbed instance creator to lazy stub any interface/class, without cal

This library provides an API to create a stubbed instance of a class or interface, including property functions, allowing overrides and excluded methods

```ts
class MyClass {
constructor(input: number) {
throw new Error("Should not be called");
}
func(input: number, text: string) {
console.log(text);
return input;
}
property: number = 3;
optionalProperty?: number;
get getter(): number {
return this.property;
}
set setter(value: number) {
throw new Error("Should not be called");
}
}

const stubbedInstanceCreator = StubbedInstanceCreator<MyClass, SinonStub>(() =>
sinon.stub()
);

const mockMyClass = StubbedInstanceCreator<MyClass, SinonStub>(() =>
sinon.stub()
).createStubbedInstance();
```

`npm i -D @shellygo/ts-stubber`

or
Expand Down
109 changes: 0 additions & 109 deletions index.html

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"cy:run": "cypress run",
"cy:open": "cypress open",
"generate-md-docs": "typedoc --includeVersion --plugin typedoc-plugin-markdown --plugin typedoc-plugin-merge-modules --options typedoc.md.json",
"generate-docs": "typedoc --includeVersion --plugin typedoc-plugin-merge-modules --options typedoc.html.json"
"generate-docs": "typedoc --includeVersion --plugin typedoc-plugin-merge-modules --options typedoc.html.json",
"deploy": "gh-pages -d docs"
},
"dependencies": {},
"devDependencies": {
Expand Down

0 comments on commit 517f40f

Please sign in to comment.