2015-11-20 11:33:07 +00:00
|
|
|
/**
|
2018-09-11 22:27:47 +00:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-11-20 11:33:07 +00:00
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-11-20 11:33:07 +00:00
|
|
|
*
|
2018-05-10 22:44:55 +00:00
|
|
|
* @format
|
2015-11-20 11:33:07 +00:00
|
|
|
*/
|
2018-05-10 22:44:55 +00:00
|
|
|
|
2015-11-20 11:33:07 +00:00
|
|
|
'use strict';
|
|
|
|
|
2018-05-14 07:09:36 +00:00
|
|
|
const BatchedBridge = require('BatchedBridge');
|
2015-12-08 23:57:34 +00:00
|
|
|
|
2018-05-14 07:09:36 +00:00
|
|
|
const warning = require('fbjs/lib/warning');
|
|
|
|
const invariant = require('fbjs/lib/invariant');
|
2015-11-20 11:33:07 +00:00
|
|
|
|
2018-05-14 07:09:36 +00:00
|
|
|
const LoggingTestModule = {
|
2015-11-20 11:33:07 +00:00
|
|
|
logToConsole: function(str) {
|
|
|
|
console.log(str);
|
|
|
|
},
|
2018-05-10 22:44:55 +00:00
|
|
|
logToConsoleAfterWait: function(str, timeout_ms) {
|
2016-10-27 08:37:06 +00:00
|
|
|
setTimeout(function() {
|
|
|
|
console.log(str);
|
|
|
|
}, timeout_ms);
|
|
|
|
},
|
2015-11-20 11:33:07 +00:00
|
|
|
warning: function(str) {
|
|
|
|
warning(false, str);
|
|
|
|
},
|
|
|
|
invariant: function(str) {
|
|
|
|
invariant(false, str);
|
|
|
|
},
|
|
|
|
logErrorToConsole: function(str) {
|
|
|
|
console.error(str);
|
|
|
|
},
|
|
|
|
throwError: function(str) {
|
|
|
|
throw new Error(str);
|
2018-05-10 22:44:55 +00:00
|
|
|
},
|
2015-11-20 11:33:07 +00:00
|
|
|
};
|
2015-12-08 23:57:34 +00:00
|
|
|
|
2018-05-10 22:44:55 +00:00
|
|
|
BatchedBridge.registerCallableModule('LoggingTestModule', LoggingTestModule);
|
2015-12-08 23:57:34 +00:00
|
|
|
|
|
|
|
module.exports = LoggingTestModule;
|