-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Substitute from "../../src/Index"; | ||
import test from 'ava'; | ||
|
||
class ClassA { | ||
constructor(){} | ||
|
||
methodA(): string { | ||
return 'abc' | ||
} | ||
} | ||
|
||
class ClassB { | ||
constructor( | ||
private classA: ClassA | ||
) {} | ||
|
||
methodB(): string { | ||
return this.classA.methodA(); | ||
} | ||
|
||
methodB2(): string { | ||
return 'def' | ||
} | ||
} | ||
|
||
class ClassC { | ||
constructor( | ||
private classB: ClassB | ||
) {} | ||
|
||
methodC(): string { | ||
return this.classB.methodB2(); | ||
} | ||
} | ||
|
||
test('issue 9: can record method with 0 arguments', async t => { | ||
This comment has been minimized.
Sorry, something went wrong.
stephenh
|
||
const classBMock = Substitute.for<ClassB>(); | ||
const classC = new ClassC(classBMock); | ||
t.not(classC, null); | ||
}); |
Ha, that is a cute fix.