I am doing testing in angular 4 in my test cases i need large amount of data. I dynamically require the json which is needed in my spec files. These files are approximately 4 to 5 MB.
Here is some reference ...
it('Multiple JSON:', () => {
rdocList.forEach(element => {
if (element.rdoc_id) {
service.rdoc = require('../mock/' +
element.rdoc_id +
'.json');
service.rdoc = new RDoc(service.rdoc);
const storage = service.rdoc.descendants.filter({
class_id: STORAGE_CLASS_IDS.ID
});
const clusterNode = storage[0].descendants.filter({
class_id: STORAGE_CLASS_IDS.CLUSTERID
});
component.id = clusterNode[0].id;
fixture.detectChanges();
}
});
});
i have cleared the json in after each..
afterEach(() => {
service.rdoc = null;
service = null;
});
i get this issue
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory