Skip to content

Commit 31e209a

Browse files
authored
Write more tests in interface_static_method.test.ts (#118)
Need more tests. ISSUE=#99,#100
1 parent 8de1fbb commit 31e209a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/interface_static_method.test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,29 @@ test('Basic of static method', async () => {
2727
expect(bacardi.TestInterface.getLastCallInfo())
2828
.toBe('static boolean staticMethod2(long, string)');
2929
});
30+
31+
test('Calling undefined static method should throw error', async () => {
32+
expect(() => {
33+
bacardi.TestInterface.undefinedStaticMethod1();
34+
}).toThrowError(TypeError);
35+
36+
expect(() => {
37+
bacardi.TestInterface.undefinedStaticMethod2(10, 'test');
38+
}).toThrowError(TypeError);
39+
});
40+
41+
test('Static method with invalid arguments should throw error', async () => {
42+
expect(() => {
43+
bacardi.TestInterface.staticMethod2(10, 20);
44+
}).toThrowError();
45+
});
46+
47+
test('Static method with invalid signature should throw error', async () => {
48+
expect(() => {
49+
bacardi.TestInterface.staticMethod1(10);
50+
}).toThrowError();
51+
52+
expect(() => {
53+
bacardi.TestInterface.staticMethod2();
54+
}).toThrowError();
55+
});

0 commit comments

Comments
 (0)