1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const config_1 = require("./config");
|
4 | exports.default = {
|
5 | warn(func, msg, url) {
|
6 | if (!(0, config_1.default)().ignoreWarnings && typeof console === 'object' && console.warn) {
|
7 | console.warn(`Warning: testdouble.js - ${func} - ${msg}${withUrl(url)}`);
|
8 | }
|
9 | },
|
10 | error(func, msg, url) {
|
11 | if (!(0, config_1.default)().suppressErrors) {
|
12 | throw new Error(`Error: testdouble.js - ${func} - ${msg}${withUrl(url)}`);
|
13 | }
|
14 | },
|
15 | fail(msg) {
|
16 | throw new Error(msg);
|
17 | }
|
18 | };
|
19 | const withUrl = (url) => url != null
|
20 | ? ` (see: ${url} )`
|
21 | : '';
|