问题
Where does document.querySelector('body')
point to in Jasmine tests?
Is it blank, or how does it look like? Is new page is loaded in "default" state for each test case or it is shared accross tests?
回答1:
The document.body
is that of the test runner HTML file which has each of your source and test files loaded into it. It is globally available and constantly there, so is the same and shared across all tests.
来源:https://stackoverflow.com/questions/39139570/what-is-document-body-in-jasmine-tests