vendredi 18 septembre 2020

Testing an object with too much data with jest and enzyme

I'm writing a test with jest and enzyme. What is the logical solution to this when we have an object with so much data and want to test it?
I have data like this:

const data = {
  "4357": {
    "id": 4357,
    "roworder": 1,
    "tasksdetails_id": 435
    .....
};

export default data;

This is the code I wrote for the test, but I do not know what to write in ```expect() section

import data from './data.object';

 test('Hide Completed', () => {
    const ids = [4357, 4388, 4389, 4390, 4391];
    const taskList = prepareTaskList(data, ids, false);
    expect....??
  });

Using expect.toBe() with that large amount of object information makes it very difficult to test.

Aucun commentaire:

Enregistrer un commentaire