From 67eb721352a585e153e4b10e0e1d55d70557adc9 Mon Sep 17 00:00:00 2001 From: "chenghuai.dtc" Date: Fri, 7 May 2021 20:55:34 +0800 Subject: [PATCH] test: change test spec order to cover this case. --- .../specs/method-channel/method-channel.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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[]) => {