Skip to content

Commit

Permalink
Write more tests in interface_static_method.test.ts (#118)
Browse files Browse the repository at this point in the history
Need more tests.

ISSUE=#99,#100
  • Loading branch information
romandev committed Oct 18, 2017
1 parent 4488430 commit 6433cb0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/interface_static_method.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,29 @@ test('Basic of static method', async () => {
expect(bacardi.TestInterface.getLastCallInfo())
.toBe('static boolean staticMethod2(long, string)');
});

test('Calling undefined static method should throw error', async () => {
expect(() => {
bacardi.TestInterface.undefinedStaticMethod1();
}).toThrowError(TypeError);

expect(() => {
bacardi.TestInterface.undefinedStaticMethod2(10, 'test');
}).toThrowError(TypeError);
});

test('Static method with invalid arguments should throw error', async () => {
expect(() => {
bacardi.TestInterface.staticMethod2(10, 20);
}).toThrowError();
});

test('Static method with invalid signature should throw error', async () => {
expect(() => {
bacardi.TestInterface.staticMethod1(10);
}).toThrowError();

expect(() => {
bacardi.TestInterface.staticMethod2();
}).toThrowError();
});

0 comments on commit 6433cb0

Please sign in to comment.