mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Prettier React Native Libraries
Reviewed By: sahrens Differential Revision: D7961488 fbshipit-source-id: 05f9b8b0b91ae77f9040a5321ccc18f7c3c1ce9a
This commit is contained in:
committed by
Facebook Github Bot
parent
1e2de71290
commit
d01ab66b47
@@ -4,8 +4,10 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @emails oncall+react_native
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
jest
|
||||
@@ -59,7 +61,12 @@ describe('MessageQueue', function() {
|
||||
const onSucc = jest.fn();
|
||||
|
||||
// Perform communication
|
||||
NativeModules.RemoteModule1.promiseMethod('paloAlto', 'menloPark', onFail, onSucc);
|
||||
NativeModules.RemoteModule1.promiseMethod(
|
||||
'paloAlto',
|
||||
'menloPark',
|
||||
onFail,
|
||||
onSucc,
|
||||
);
|
||||
NativeModules.RemoteModule2.promiseMethod('mac', 'windows', onFail, onSucc);
|
||||
|
||||
const resultingRemoteInvocations = BatchedBridge.flushedQueue();
|
||||
@@ -73,9 +80,10 @@ describe('MessageQueue', function() {
|
||||
|
||||
expect(resultingRemoteInvocations[0][0]).toBe(0); // `RemoteModule1`
|
||||
expect(resultingRemoteInvocations[1][0]).toBe(1); // `promiseMethod`
|
||||
expect([ // the arguments
|
||||
expect([
|
||||
// the arguments
|
||||
resultingRemoteInvocations[2][0][0],
|
||||
resultingRemoteInvocations[2][0][1]
|
||||
resultingRemoteInvocations[2][0][1],
|
||||
]).toEqual(['paloAlto', 'menloPark']);
|
||||
// Callbacks ids are tacked onto the end of the remote arguments.
|
||||
const firstFailCBID = resultingRemoteInvocations[2][0][2];
|
||||
@@ -83,9 +91,10 @@ describe('MessageQueue', function() {
|
||||
|
||||
expect(resultingRemoteInvocations[0][1]).toBe(1); // `RemoteModule2`
|
||||
expect(resultingRemoteInvocations[1][1]).toBe(1); // `promiseMethod`
|
||||
expect([ // the arguments
|
||||
expect([
|
||||
// the arguments
|
||||
resultingRemoteInvocations[2][1][0],
|
||||
resultingRemoteInvocations[2][1][1]
|
||||
resultingRemoteInvocations[2][1][1],
|
||||
]).toEqual(['mac', 'windows']);
|
||||
const secondFailCBID = resultingRemoteInvocations[2][1][2];
|
||||
const secondSuccCBID = resultingRemoteInvocations[2][1][3];
|
||||
|
||||
Reference in New Issue
Block a user