I would like to capture the data from a webpage by using the querySelector and write a unit test to verify the data. But I don't know how to insert the Page to Jasmine for testing.For example:
In the main.js
function test()
{
return document.querySelectorAll(`[id*="xxxxx"]`).length;
}
In the test.js
describe("test", function(){
it("should be able to find the length", function() {
expect(test()).toEqual(10);
});
});