concept ItemList in category javascript
appears as: ItemList, ItemList

This is an excerpt from Manning's book Testing JavaScript Applications.
Additionally, you must call
jest.resetModulesbefore requiringmain.js. Otherwise, Jest will get./main.jsfrom its cache, preventing it from being executed again.Listing 6.38. main.test.js
const fs = require("fs"); const initialHtml = fs.readFileSync("./index.html"); beforeEach(() => { document.body.innerHTML = initialHtml; jest.resetModules(); #1 require("./main"); #2 });
Figure 8.3. The tests which break if you decide to change the format of the text rendered by
ItemList.![]()