When I run "yarn test tests/screens/Home/Home.js", I encountered "javascript memory leak" error. and this file is created. File name is "report.20191007.162344.626.0.001.json"
What Can I Do?
{
"header": {
"event": "Allocation failed - JavaScript heap out of memory",
"trigger": "FatalError",
"filename": "report.20191007.162344.626.0.001.json",
"dumpEventTime": "2019-10-07T16:23:44Z",
"dumpEventTimeStamp": "1570433024575",
"processId": 626,
"commandLine": [
"/usr/local/bin/node",
"/my app path~/node_modules/.bin/jest",
"__tests__/screens/Home/Home.test.js"
],
"nodejsVersion": "v12.5.0",
"wordSize": 64,
"arch": "x64",
"platform": "darwin",
"componentVersions": {
"node": "12.5.0",
"v8": "7.5.288.22-node.14",
"uv": "1.29.1",
"zlib": "1.2.11",
"brotli": "1.0.7",
"ares": "1.15.0",
"modules": "72",
"nghttp2": "1.38.0",
"napi": "4",
"llhttp": "1.1.4",
"http_parser": "2.8.0",
"openssl": "1.1.1c",
"cldr": "35.1",
"icu": "64.2",
"tz": "2019a",
"unicode": "12.1"
},
}
Home.test.js
import React from 'react';
import renderer from 'react-test-renderer';
import Home from '../../../src/screens/Home/Home';
import configureStore from '../../../src/store/configureStore'
const store = configureStore();
test('renders correctly', () => {
const tree = renderer.create(<Home store={store} />).toJSON();
expect(tree).toMatchSnapshot();
});