gpt4 book ai didi

javascript - Jasmine SpyOn 测试不起作用

转载 作者:行者123 更新时间:2023-11-28 02:13:04 26 4
gpt4 key购买 nike

我将 Jasmine-Species 与 jasmine 一起用于 GWT

我编写了一个如下所示的测试

feature('checking spy', function() {

summary(
'In order to check how spy work ',
'I should have a class on which i can work '
);
scenario('Spy should tell me function is called or not ', function() {

given('A Class to work on ', function() {
window.signInObj = new SignIn();

});
when('I Spy on a function and call it ', function() {

spyOn(signInObj, "fillForm");
signInObj.fillForm("world",'hello');

});
then('Spy Should tell me that function is called or not', function() {
expect(signInObj.fillForm).toHaveBeenCalled();
});

});
});

当我尝试在 vs 的测试资源管理器中运行此测试时,它给了我这个

Test adapter sent back a result for an unknown test case. Ignoring result for 'Feature: checking spy Scenario: Spy should tell me function is called or not '.

是我的测试有问题还是有其他问题

提前致谢。

最佳答案

这是 Visual Studio 重新启动时出现的问题。它会自动修复所有问题。

关于javascript - Jasmine SpyOn 测试不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16808019/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com