diff --git a/integration_tests/specs/method-channel/method-channel.ts b/integration_tests/specs/method-channel/method-channel.ts index 9e370c95c4..31ad120137 100644 --- a/integration_tests/specs/method-channel/method-channel.ts +++ b/integration_tests/specs/method-channel/method-channel.ts @@ -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 @@ -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[]) => {