Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@callstack/reassure-measure

Package Overview
Dependencies
Maintainers
8
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@callstack/reassure-measure - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

lib/typescript/config.d.ts.map

8

lib/commonjs/config.js

@@ -12,4 +12,3 @@ "use strict";

dropWorst: 1,
outputFile: process.env.OUTPUT_FILE ?? '.reassure/current.perf',
verbose: false,
outputFile: process.env.REASSURE_OUTPUT_FILE ?? '.reassure/current.perf',
testingLibrary: undefined

@@ -19,9 +18,8 @@ };

exports.config = config;
function configure(customConfig) {
exports.config = config = { ...defaultConfig,
exports.config = config = {
...defaultConfig,
...customConfig
};
}
function resetToDefault() {

@@ -28,0 +26,0 @@ exports.config = config = defaultConfig;

@@ -24,6 +24,4 @@ "use strict";

});
var _config = require("./config");
var _measure = require("./measure");
//# sourceMappingURL=index.js.map

@@ -8,17 +8,14 @@ "use strict";

exports.measureRender = measureRender;
var React = _interopRequireWildcard(require("react"));
var math = _interopRequireWildcard(require("mathjs"));
var _reassureLogger = require("@callstack/reassure-logger");
var _config = require("./config");
var _output = require("./output");
var _testingLibrary = require("./testingLibrary");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
_reassureLogger.logger.configure({
verbose: process.env.REASSURE_VERBOSE === 'true' || process.env.REASSURE_VERBOSE === '1',
silent: process.env.REASSURE_SILENT === 'true' || process.env.REASSURE_SILENT === '1'
});
async function measurePerformance(ui, options) {

@@ -29,3 +26,2 @@ const stats = await measureRender(ui, options);

}
async function measureRender(ui, options) {

@@ -44,14 +40,10 @@ const runs = (options === null || options === void 0 ? void 0 : options.runs) ?? _config.config.runs;

} = (0, _testingLibrary.resolveTestingLibrary)();
for (let i = 0; i < runs + dropWorst; i += 1) {
var _global$gc, _global;
let duration = 0;
let count = 0;
let isFinished = false;
const handleRender = (_id, _phase, actualDuration) => {
duration += actualDuration;
count += 1;
if (isFinished) {

@@ -61,3 +53,2 @@ hasTooLateRender = true;

};
const screen = render( /*#__PURE__*/React.createElement(React.Profiler, {

@@ -67,7 +58,5 @@ id: "Test",

}, wrappedUi));
if (scenario) {
await scenario(screen);
}
cleanup();

@@ -81,11 +70,9 @@ isFinished = true;

}
if (hasTooLateRender) {
const testName = expect.getState().currentTestName;
console.error(`Warning: test "${testName}" still re-renders after test scenario finished.\n\nPlease update your code to wait for all renders to finish.`);
} // Drop worst measurements outliers (usually warm up runs)
_reassureLogger.logger.warn(`test "${testName}" still re-renders after test scenario finished.\n\nPlease update your code to wait for all renders to finish.`);
}
// Drop worst measurements outliers (usually warm up runs)
entries.sort((first, second) => second.duration - first.duration); // duration DESC
entries = entries.slice(dropWorst);

@@ -92,0 +79,0 @@ const durations = entries.map(entry => entry.duration);

@@ -9,11 +9,7 @@ "use strict";

exports.writeTestStats = writeTestStats;
var fs = _interopRequireWildcard(require("fs/promises"));
var _reassureLogger = require("@callstack/reassure-logger");
var _config = require("./config");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
async function writeTestStats(result) {

@@ -26,23 +22,18 @@ let outputFilePath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _config.config.outputFile;

}) + '\n';
try {
await fs.appendFile(outputFilePath, line);
} catch (error) {
console.error(`Error writing ${outputFilePath}`, error);
_reassureLogger.logger.error(`Error writing ${outputFilePath}`, error);
throw error;
}
}
async function clearTestStats() {
let outputFilePath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _config.config.outputFile;
try {
await fs.unlink(outputFilePath);
} catch (error) {
console.warn(`Cannot remove ${outputFilePath}. File doesn't exist or cannot be removed`);
_reassureLogger.logger.warn(`Cannot remove ${outputFilePath}. File doesn't exist or cannot be removed`);
}
}
let hasShowFlagsOutput = false;
function showFlagsOuputIfNeeded() {

@@ -52,11 +43,9 @@ if (hasShowFlagsOutput) {

}
if (!global.gc) {
console.error('❌ Reassure: measure code is running under incorrect Node.js configuration.\n' + 'Performance test code should be run in Jest with certain Node.js flags to increase measurements stability.\n' + 'Make sure you use the Reassure CLI and run it using "reassure" command.');
} else if (_config.config.verbose) {
console.log('✅ Reassure: measure code is running under correct node flags');
_reassureLogger.logger.error('❌ Measure code is running under incorrect Node.js configuration.\n' + 'Performance test code should be run in Jest with certain Node.js flags to increase measurements stability.\n' + 'Make sure you use the Reassure CLI and run it using "reassure" command.');
} else {
_reassureLogger.logger.verbose('Measure code is running with correct Node.js configuration.');
}
hasShowFlagsOutput = true;
}
//# sourceMappingURL=output.js.map

@@ -7,21 +7,18 @@ "use strict";

exports.resolveTestingLibrary = resolveTestingLibrary;
var _reassureLogger = require("@callstack/reassure-logger");
var _config = require("./config");
let RNTL;
try {
// eslint-disable-next-line import/no-extraneous-dependencies
RNTL = require('@testing-library/react-native');
} catch (error) {// Do nothing
} catch (error) {
// Do nothing
}
let RTL;
try {
// eslint-disable-next-line import/no-extraneous-dependencies
RTL = require('@testing-library/react');
} catch (error) {// Do nothing
} catch (error) {
// Do nothing
}
function resolveTestingLibrary() {

@@ -32,44 +29,36 @@ // Explicit testing library option

if (!RNTL) {
throw new Error(`Reassure: unable to import '@testing-library/react-native' dependency`);
throw new Error(`Unable to import '@testing-library/react-native' dependency`);
}
if (_config.config.verbose) console.log(`Reassure: using '@testing-library/react-native' to render components`);
_reassureLogger.logger.verbose(`Using '@testing-library/react-native' to render components`);
return RNTL;
}
if (_config.config.testingLibrary === 'react') {
if (!RTL) {
throw new Error(`Reassure: unable to import '@testing-library/react' dependency`);
throw new Error(`Unable to import '@testing-library/react' dependency`);
}
if (_config.config.verbose) console.log(`Reassure: using '@testing-library/react' to render components`);
_reassureLogger.logger.verbose(`Using '@testing-library/react' to render components`);
return RTL;
}
if (typeof _config.config.testingLibrary === 'object' && typeof _config.config.testingLibrary.render === 'function' && typeof _config.config.testingLibrary.cleanup === 'function') {
if (_config.config.verbose) console.log(`Reassure: using custom 'render' and 'cleanup' functions to render components`);
_reassureLogger.logger.verbose(`Using custom 'render' and 'cleanup' functions to render components`);
return _config.config.testingLibrary;
}
throw new Error(`Unsupported 'testingLibrary' value. Please set 'testingLibrary' to one of following values: 'react-native', 'react' or { render, cleanup }.`);
}
throw new Error(`Reassure: unsupported 'testingLibrary' value. Please set 'testingLibrary' to one of following values: 'react-native', 'react' or { render, cleanup }.`);
} // Testing library auto-detection
// Testing library auto-detection
if (RNTL != null && RTL != null) {
console.warn(`Reassure: both '@testing-library/react-native' and '@testing-library/react' are installed. Using '@testing-library/react-native' by default.` + `\nYou can resolve this warning by explicitly calling 'configure({ testingLibrary: 'react-native' })' or 'configure({ testingLibrary: 'react' })' in your test setup file.`);
_reassureLogger.logger.warn("Both '@testing-library/react-native' and '@testing-library/react' are installed. Using '@testing-library/react-native' by default.\n\nYou can resolve this warning by explicitly calling 'configure({ testingLibrary: 'react-native' })' or 'configure({ testingLibrary: 'react' })' in your test setup file.");
return RNTL;
}
if (RNTL != null) {
if (_config.config.verbose) console.log(`Reassure: using '@testing-library/react-native' to render components`);
_reassureLogger.logger.verbose(`Using '@testing-library/react-native' to render components`);
return RNTL;
}
if (RTL != null) {
if (_config.config.verbose) console.log(`Reassure: using '@testing-library/react' to render components`);
_reassureLogger.logger.verbose(`Using '@testing-library/react' to render components`);
return RTL;
}
throw new Error(`Reassure: unable to import neither '@testing-library/react-native' nor '@testing-library/react'.` + `\nAdd either of these testing libraries to your 'package.json'`);
throw new Error(`Unable to import neither '@testing-library/react-native' nor '@testing-library/react'.` + `\nAdd either of these testing libraries to your 'package.json'`);
}
//# sourceMappingURL=testingLibrary.js.map
const defaultConfig = {
runs: 10,
dropWorst: 1,
outputFile: process.env.OUTPUT_FILE ?? '.reassure/current.perf',
verbose: false,
outputFile: process.env.REASSURE_OUTPUT_FILE ?? '.reassure/current.perf',
testingLibrary: undefined

@@ -10,3 +9,4 @@ };

export function configure(customConfig) {
config = { ...defaultConfig,
config = {
...defaultConfig,
...customConfig

@@ -13,0 +13,0 @@ };

import * as React from 'react';
import * as math from 'mathjs';
import { logger } from '@callstack/reassure-logger';
import { config } from './config';
import { showFlagsOuputIfNeeded, writeTestStats } from './output';
import { resolveTestingLibrary } from './testingLibrary';
logger.configure({
verbose: process.env.REASSURE_VERBOSE === 'true' || process.env.REASSURE_VERBOSE === '1',
silent: process.env.REASSURE_SILENT === 'true' || process.env.REASSURE_SILENT === '1'
});
export async function measurePerformance(ui, options) {

@@ -24,14 +29,10 @@ const stats = await measureRender(ui, options);

} = resolveTestingLibrary();
for (let i = 0; i < runs + dropWorst; i += 1) {
var _global$gc, _global;
let duration = 0;
let count = 0;
let isFinished = false;
const handleRender = (_id, _phase, actualDuration) => {
duration += actualDuration;
count += 1;
if (isFinished) {

@@ -41,3 +42,2 @@ hasTooLateRender = true;

};
const screen = render( /*#__PURE__*/React.createElement(React.Profiler, {

@@ -47,7 +47,5 @@ id: "Test",

}, wrappedUi));
if (scenario) {
await scenario(screen);
}
cleanup();

@@ -61,11 +59,9 @@ isFinished = true;

}
if (hasTooLateRender) {
const testName = expect.getState().currentTestName;
console.error(`Warning: test "${testName}" still re-renders after test scenario finished.\n\nPlease update your code to wait for all renders to finish.`);
} // Drop worst measurements outliers (usually warm up runs)
logger.warn(`test "${testName}" still re-renders after test scenario finished.\n\nPlease update your code to wait for all renders to finish.`);
}
// Drop worst measurements outliers (usually warm up runs)
entries.sort((first, second) => second.duration - first.duration); // duration DESC
entries = entries.slice(dropWorst);

@@ -72,0 +68,0 @@ const durations = entries.map(entry => entry.duration);

import * as fs from 'fs/promises';
import { logger } from '@callstack/reassure-logger';
import { config } from './config';

@@ -10,7 +11,6 @@ export async function writeTestStats(result) {

}) + '\n';
try {
await fs.appendFile(outputFilePath, line);
} catch (error) {
console.error(`Error writing ${outputFilePath}`, error);
logger.error(`Error writing ${outputFilePath}`, error);
throw error;

@@ -21,7 +21,6 @@ }

let outputFilePath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : config.outputFile;
try {
await fs.unlink(outputFilePath);
} catch (error) {
console.warn(`Cannot remove ${outputFilePath}. File doesn't exist or cannot be removed`);
logger.warn(`Cannot remove ${outputFilePath}. File doesn't exist or cannot be removed`);
}

@@ -34,11 +33,9 @@ }

}
if (!global.gc) {
console.error('❌ Reassure: measure code is running under incorrect Node.js configuration.\n' + 'Performance test code should be run in Jest with certain Node.js flags to increase measurements stability.\n' + 'Make sure you use the Reassure CLI and run it using "reassure" command.');
} else if (config.verbose) {
console.log('✅ Reassure: measure code is running under correct node flags');
logger.error('❌ Measure code is running under incorrect Node.js configuration.\n' + 'Performance test code should be run in Jest with certain Node.js flags to increase measurements stability.\n' + 'Make sure you use the Reassure CLI and run it using "reassure" command.');
} else {
logger.verbose('Measure code is running with correct Node.js configuration.');
}
hasShowFlagsOutput = true;
}
//# sourceMappingURL=output.js.map

@@ -0,18 +1,17 @@

import { logger } from '@callstack/reassure-logger';
import { config } from './config';
let RNTL;
try {
// eslint-disable-next-line import/no-extraneous-dependencies
RNTL = require('@testing-library/react-native');
} catch (error) {// Do nothing
} catch (error) {
// Do nothing
}
let RTL;
try {
// eslint-disable-next-line import/no-extraneous-dependencies
RTL = require('@testing-library/react');
} catch (error) {// Do nothing
} catch (error) {
// Do nothing
}
export function resolveTestingLibrary() {

@@ -23,44 +22,36 @@ // Explicit testing library option

if (!RNTL) {
throw new Error(`Reassure: unable to import '@testing-library/react-native' dependency`);
throw new Error(`Unable to import '@testing-library/react-native' dependency`);
}
if (config.verbose) console.log(`Reassure: using '@testing-library/react-native' to render components`);
logger.verbose(`Using '@testing-library/react-native' to render components`);
return RNTL;
}
if (config.testingLibrary === 'react') {
if (!RTL) {
throw new Error(`Reassure: unable to import '@testing-library/react' dependency`);
throw new Error(`Unable to import '@testing-library/react' dependency`);
}
if (config.verbose) console.log(`Reassure: using '@testing-library/react' to render components`);
logger.verbose(`Using '@testing-library/react' to render components`);
return RTL;
}
if (typeof config.testingLibrary === 'object' && typeof config.testingLibrary.render === 'function' && typeof config.testingLibrary.cleanup === 'function') {
if (config.verbose) console.log(`Reassure: using custom 'render' and 'cleanup' functions to render components`);
logger.verbose(`Using custom 'render' and 'cleanup' functions to render components`);
return config.testingLibrary;
}
throw new Error(`Unsupported 'testingLibrary' value. Please set 'testingLibrary' to one of following values: 'react-native', 'react' or { render, cleanup }.`);
}
throw new Error(`Reassure: unsupported 'testingLibrary' value. Please set 'testingLibrary' to one of following values: 'react-native', 'react' or { render, cleanup }.`);
} // Testing library auto-detection
// Testing library auto-detection
if (RNTL != null && RTL != null) {
console.warn(`Reassure: both '@testing-library/react-native' and '@testing-library/react' are installed. Using '@testing-library/react-native' by default.` + `\nYou can resolve this warning by explicitly calling 'configure({ testingLibrary: 'react-native' })' or 'configure({ testingLibrary: 'react' })' in your test setup file.`);
logger.warn("Both '@testing-library/react-native' and '@testing-library/react' are installed. Using '@testing-library/react-native' by default.\n\nYou can resolve this warning by explicitly calling 'configure({ testingLibrary: 'react-native' })' or 'configure({ testingLibrary: 'react' })' in your test setup file.");
return RNTL;
}
if (RNTL != null) {
if (config.verbose) console.log(`Reassure: using '@testing-library/react-native' to render components`);
logger.verbose(`Using '@testing-library/react-native' to render components`);
return RNTL;
}
if (RTL != null) {
if (config.verbose) console.log(`Reassure: using '@testing-library/react' to render components`);
logger.verbose(`Using '@testing-library/react' to render components`);
return RTL;
}
throw new Error(`Reassure: unable to import neither '@testing-library/react-native' nor '@testing-library/react'.` + `\nAdd either of these testing libraries to your 'package.json'`);
throw new Error(`Unable to import neither '@testing-library/react-native' nor '@testing-library/react'.` + `\nAdd either of these testing libraries to your 'package.json'`);
}
//# sourceMappingURL=testingLibrary.js.map
/// <reference types="react" />
export declare type TestingLibrary = 'react' | 'react-native' | {
export type TestingLibrary = 'react' | 'react-native' | {
render: Render;
cleanup: Cleanup;
};
export declare type Render = (component: React.ReactElement<any>) => any;
export declare type Cleanup = () => void;
declare type Config = {
export type Render = (component: React.ReactElement<any>) => any;
export type Cleanup = () => void;
type Config = {
runs: number;
dropWorst: number;
outputFile: string;
verbose: boolean;
testingLibrary?: TestingLibrary;

@@ -19,1 +18,2 @@ };

export {};
//# sourceMappingURL=config.d.ts.map
export { configure, resetToDefault } from './config';
export { measurePerformance } from './measure';
export type { MeasureOptions } from './measure';
//# sourceMappingURL=index.d.ts.map

@@ -11,1 +11,2 @@ import * as React from 'react';

export declare function measureRender(ui: React.ReactElement, options?: MeasureOptions): Promise<MeasureRenderResult>;
//# sourceMappingURL=measure.d.ts.map

@@ -5,1 +5,2 @@ import type { MeasureRenderResult } from './types';

export declare function showFlagsOuputIfNeeded(): void;
//# sourceMappingURL=output.d.ts.map
import { Render, Cleanup } from './config';
declare type TestingLibraryApi = {
type TestingLibraryApi = {
render: Render;

@@ -8,1 +8,2 @@ cleanup: Cleanup;

export {};
//# sourceMappingURL=testingLibrary.d.ts.map

@@ -25,1 +25,2 @@ /**

}
//# sourceMappingURL=types.d.ts.map
{
"name": "@callstack/reassure-measure",
"version": "0.3.1",
"version": "0.4.0",
"description": "Performance measurement library for React and React Native",

@@ -39,3 +39,4 @@ "main": "lib/commonjs/index",

"dependencies": {
"mathjs": "^10.1.1"
"@callstack/reassure-logger": "0.2.0",
"mathjs": "^11.5.0"
},

@@ -56,6 +57,3 @@ "peerDependencies": {

"access": "public"
},
"devDependencies": {
"typescript": "^4.5.2"
}
}

@@ -10,3 +10,2 @@ export type TestingLibrary = 'react' | 'react-native' | { render: Render; cleanup: Cleanup };

outputFile: string;
verbose: boolean;
testingLibrary?: TestingLibrary;

@@ -18,4 +17,3 @@ };

dropWorst: 1,
outputFile: process.env.OUTPUT_FILE ?? '.reassure/current.perf',
verbose: false,
outputFile: process.env.REASSURE_OUTPUT_FILE ?? '.reassure/current.perf',
testingLibrary: undefined,

@@ -22,0 +20,0 @@ };

import * as fs from 'fs/promises';
import { logger } from '@callstack/reassure-logger';
import { config } from './config';

@@ -15,3 +16,3 @@ import type { MeasureRenderResult } from './types';

} catch (error) {
console.error(`Error writing ${outputFilePath}`, error);
logger.error(`Error writing ${outputFilePath}`, error);
throw error;

@@ -25,3 +26,3 @@ }

} catch (error) {
console.warn(`Cannot remove ${outputFilePath}. File doesn't exist or cannot be removed`);
logger.warn(`Cannot remove ${outputFilePath}. File doesn't exist or cannot be removed`);
}

@@ -38,9 +39,9 @@ }

if (!global.gc) {
console.error(
'❌ Reassure: measure code is running under incorrect Node.js configuration.\n' +
logger.error(
'❌ Measure code is running under incorrect Node.js configuration.\n' +
'Performance test code should be run in Jest with certain Node.js flags to increase measurements stability.\n' +
'Make sure you use the Reassure CLI and run it using "reassure" command.'
);
} else if (config.verbose) {
console.log('✅ Reassure: measure code is running under correct node flags');
} else {
logger.verbose('Measure code is running with correct Node.js configuration.');
}

@@ -47,0 +48,0 @@

@@ -0,1 +1,2 @@

import { logger } from '@callstack/reassure-logger';
import { config, Render, Cleanup } from './config';

@@ -29,6 +30,6 @@

if (!RNTL) {
throw new Error(`Reassure: unable to import '@testing-library/react-native' dependency`);
throw new Error(`Unable to import '@testing-library/react-native' dependency`);
}
if (config.verbose) console.log(`Reassure: using '@testing-library/react-native' to render components`);
logger.verbose(`Using '@testing-library/react-native' to render components`);
return RNTL;

@@ -39,6 +40,6 @@ }

if (!RTL) {
throw new Error(`Reassure: unable to import '@testing-library/react' dependency`);
throw new Error(`Unable to import '@testing-library/react' dependency`);
}
if (config.verbose) console.log(`Reassure: using '@testing-library/react' to render components`);
logger.verbose(`Using '@testing-library/react' to render components`);
return RTL;

@@ -52,3 +53,3 @@ }

) {
if (config.verbose) console.log(`Reassure: using custom 'render' and 'cleanup' functions to render components`);
logger.verbose(`Using custom 'render' and 'cleanup' functions to render components`);
return config.testingLibrary;

@@ -58,3 +59,3 @@ }

throw new Error(
`Reassure: unsupported 'testingLibrary' value. Please set 'testingLibrary' to one of following values: 'react-native', 'react' or { render, cleanup }.`
`Unsupported 'testingLibrary' value. Please set 'testingLibrary' to one of following values: 'react-native', 'react' or { render, cleanup }.`
);

@@ -65,5 +66,4 @@ }

if (RNTL != null && RTL != null) {
console.warn(
`Reassure: both '@testing-library/react-native' and '@testing-library/react' are installed. Using '@testing-library/react-native' by default.` +
`\nYou can resolve this warning by explicitly calling 'configure({ testingLibrary: 'react-native' })' or 'configure({ testingLibrary: 'react' })' in your test setup file.`
logger.warn(
"Both '@testing-library/react-native' and '@testing-library/react' are installed. Using '@testing-library/react-native' by default.\n\nYou can resolve this warning by explicitly calling 'configure({ testingLibrary: 'react-native' })' or 'configure({ testingLibrary: 'react' })' in your test setup file."
);

@@ -75,3 +75,3 @@

if (RNTL != null) {
if (config.verbose) console.log(`Reassure: using '@testing-library/react-native' to render components`);
logger.verbose(`Using '@testing-library/react-native' to render components`);
return RNTL;

@@ -81,3 +81,3 @@ }

if (RTL != null) {
if (config.verbose) console.log(`Reassure: using '@testing-library/react' to render components`);
logger.verbose(`Using '@testing-library/react' to render components`);
return RTL;

@@ -87,5 +87,5 @@ }

throw new Error(
`Reassure: unable to import neither '@testing-library/react-native' nor '@testing-library/react'.` +
`Unable to import neither '@testing-library/react-native' nor '@testing-library/react'.` +
`\nAdd either of these testing libraries to your 'package.json'`
);
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc