Skip to content

Commit

Permalink
fix: update mock class
Browse files Browse the repository at this point in the history
  • Loading branch information
milosbugarinovic committed Dec 27, 2020
1 parent fa9722d commit 2fbd16b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/logger-strategy.test.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 14 additions & 9 deletions lib/logger-strategy.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/logger-strategy.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/logger-strategy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ export interface MockLoggerStrategy {
warn: SinonStub<any[], void>
}

export const mockLoggerStrategy = (sandbox: SinonSandbox): any =>
class implements LoggerStrategy, MockLoggerStrategy {
public stub_constructor = sandbox.stub()
export const mockLoggerStrategy = (sandbox: SinonSandbox): any => {
const stub_constructor = sandbox.stub()
return class implements LoggerStrategy, MockLoggerStrategy {
public static STUB_CONSTRUCTOR = stub_constructor
public constructor(...args: any[]) {
this.stub_constructor(...args)
stub_constructor(...args)
}

public debug = sandbox.stub()
public error = sandbox.stub()
public info = sandbox.stub()
public warn = sandbox.stub()
}
}

0 comments on commit 2fbd16b

Please sign in to comment.