Jasmine SpyOn Test无效

时间:2013-05-29 07:34:26

标签: javascript unit-testing bdd jasmine

我正在使用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();
    });

});
});

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

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 '.

我的测试中是否存在问题或者还有其他问题

提前致谢。

1 个答案:

答案 0 :(得分:1)

重新启动Visual Studio时出现问题。它会自动修复所有内容。