mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
cd9adda651
Summary: The files in `ReactAndroid/src/androidTest/js` use Haste names; this commit migrates them to use path-based imports. This helps us move RN towards standard path-based requires. All the requires in `androidTest` have been rewritten to use relative requires. [General] [Changed] - Migrate "androidTest" JS from Haste to path-based requires Pull Request resolved: https://github.com/facebook/react-native/pull/24813 Differential Revision: D15318108 Pulled By: cpojer fbshipit-source-id: dddc68f992b8dea48afb01fd4481bd5b846231ca
39 lines
774 B
JavaScript
39 lines
774 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 {NativeModules} = require('react-native');
|
|
|
|
const {Assert} = NativeModules;
|
|
|
|
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;
|