mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-13 00:08:05 +08:00
Summary: I removed var in ReactAndroid/src/androidTest. - [x] npm run prettier - [x] npm run flow-check-ios - [x] npm run flow-check-android [GENERAL] [ReactAndroid/src/androidTest] - remove var Pull Request resolved: https://github.com/facebook/react-native/pull/22137 Differential Revision: D12921228 Pulled By: TheSavior fbshipit-source-id: d3b7380b6047fc304265d0f47a53cb1170a6aea6
37 lines
740 B
JavaScript
37 lines
740 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const Assert = require('NativeModules').Assert;
|
|
|
|
const Asserts = {
|
|
assertEquals: function(expected, actual, msg) {
|
|
if (expected !== actual) {
|
|
Assert.fail(
|
|
msg ||
|
|
'Expected: ' +
|
|
expected +
|
|
', received: ' +
|
|
actual +
|
|
'\n' +
|
|
'at ' +
|
|
new Error().stack,
|
|
);
|
|
} else {
|
|
Assert.success();
|
|
}
|
|
},
|
|
assertTrue: function(expr, msg) {
|
|
Asserts.assertEquals(true, expr, msg);
|
|
},
|
|
};
|
|
|
|
module.exports = Asserts;
|