Skip to content

Commit b6daeea

Browse files
test(TestingActual): add.
1 parent 216b6ab commit b6daeea

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/test/testing-actual.spec.ts

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { TestingActual } from "../lib";
2+
3+
const t = new TestingActual();
4+
5+
class ClassA {
6+
public methodA(value?: any) {
7+
return "methodA";
8+
}
9+
10+
public methodB(value?: any) {
11+
return "methodB";
12+
}
13+
}
14+
15+
const classA = new ClassA();
16+
17+
t.describe('TestingActual', () => {
18+
19+
//
20+
t
21+
.actual('a b c d e f g h i j k l m n o p r s')
22+
.toBeString()
23+
.stringIncludes(['f'])
24+
.stringIncludesSome(['f', 'z'])
25+
.stringOfLengthBetween(27, 47)
26+
.toBeStringType()
27+
28+
t
29+
.beforeEach(() => {
30+
spyOn(classA, "methodA");
31+
classA.methodA({test: 27});
32+
})
33+
.spy(() => classA.methodA)
34+
.toHaveBeenCalled()
35+
.toHaveBeenCalledWith({test: 27})
36+
.toHaveBeenCalledTimes(1)
37+
.toHaveBeenCalledOnceWith({test: 27})
38+
});

0 commit comments

Comments
 (0)