Relative Content

Tag Archive for javascriptjestjs

TypeError: Cannot read properties of null (reading ‘map’);

function stableSort(array, comparator) { const stabilizedThis = array.map((el, index) => [el, index]); stabilizedThis.sort((a, b) => { const order = comparator(a[0], b[0]); if (order !== 0) { return order; } return a[1] – b[1]; }); return stabilizedThis.map((el) => el[0]); } in need to test this by using jest explain me give me the test case javascript […]

avoid jest running in watch mode

when i use npm run test it run the jest in mode but i only want to run it once, is there a way to avoid the jest running in watch mode by default