mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-22 17:46:56 +03:00
ebb0818093
* Start converting to jest * Use toMatch * Finish * Remove commented out code * Remove @babel/register
26 lines
723 B
JavaScript
26 lines
723 B
JavaScript
import '@babel/polyfill';
|
|
import { bigArray, bigString, circularData } from './data';
|
|
import { listenMessage } from '../utils/inject';
|
|
import '../../src/browser/extension/inject/pageScript';
|
|
|
|
function test(title, data, maxTime = 100) {
|
|
it('should send ' + title, async () => {
|
|
const start = new Date();
|
|
await listenMessage(() => {
|
|
window.__REDUX_DEVTOOLS_EXTENSION__.send(
|
|
{ type: 'TEST_ACTION', data },
|
|
data
|
|
);
|
|
});
|
|
const ms = new Date() - start;
|
|
// console.log(ms);
|
|
expect(ms).toBeLessThan(maxTime);
|
|
});
|
|
}
|
|
|
|
describe('Perf', () => {
|
|
test('a huge string', bigString);
|
|
test('a huge array', bigArray);
|
|
test('an object with circular references', circularData);
|
|
});
|