1
当我尝试写这个测试用例。如何在茉莉花测试中为[object NodeList]编写测试用例?
let abc = document.querySelectorAll("span");
expect(abc).toBe(true);
我越来越
预计[对象节点列表]是真。
当我尝试写这个测试用例。如何在茉莉花测试中为[object NodeList]编写测试用例?
let abc = document.querySelectorAll("span");
expect(abc).toBe(true);
我越来越
预计[对象节点列表]是真。
那么一个nodelist不承担一个布尔值,以便测试将失败。请检查列表是否不为空(空)。
expect(abc).not.toBeNull()