什么是Jasmine测试中的document.body? [英] What is document.body in Jasmine tests?

查看:97
本文介绍了什么是Jasmine测试中的document.body?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

document.querySelector('body')在Jasmine测试中指向哪里?

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?

推荐答案

document.body 测试跑步者HTML文件,其中包含每个源文件和测试文件。它在全球范围内可用且不断存在,因此在所有测试中都是相同的并且共享。

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.

这篇关于什么是Jasmine测试中的document.body?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆