Skip to content

Commit

Permalink
test: change test spec order to cover this case.
Browse files Browse the repository at this point in the history
  • Loading branch information
andycall committed May 7, 2021
1 parent 8724284 commit 67eb721
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions integration_tests/specs/method-channel/method-channel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
describe('MethodChannel', () => {
it('setMethodCallHandler multi params', async (done) => {
kraken.methodChannel.setMethodCallHandler((method: string, args: any[]) => {
expect(method).toBe('helloworld');
expect(args).toEqual(['abc', 1234, null, /* undefined will be converted to */ null, [], true, false, {name: 1}]);
done();
});
let result = await kraken.methodChannel.invokeMethod('helloworld', 'abc', 1234, null, undefined, [], true, false, {name: 1});
expect(result).toBe('method: helloworld');
});

it('invokeMethod', async () => {
let result = await kraken.methodChannel.invokeMethod('helloworld', 'abc');
// TEST App will return method string
Expand All @@ -15,16 +25,6 @@ describe('MethodChannel', () => {
expect(result).toBe('method: helloworld');
});

it('setMethodCallHandler multi params', async (done) => {
kraken.methodChannel.setMethodCallHandler((method: string, args: any[]) => {
expect(method).toBe('helloworld');
expect(args).toEqual(['abc', 1234, null, /* undefined will be converted to */ null, [], true, false, {name: 1}]);
done();
});
let result = await kraken.methodChannel.invokeMethod('helloworld', 'abc', 1234, null, undefined, [], true, false, {name: 1});
expect(result).toBe('method: helloworld');
});

it('setMethodCallHandler multi params with multi handler', async (done) => {
let handlerCount = 0;
kraken.methodChannel.setMethodCallHandler((method: string, args: any[]) => {
Expand Down

0 comments on commit 67eb721

Please sign in to comment.