【问题标题】:Karma running old test file [AngularJS, Karma, Jasmine, PhantomJS]Karma 运行旧测试文件 [AngularJS、Karma、Jasmine、PhantomJS]
【发布时间】:2016-10-06 11:53:42
【问题描述】:

我不知道为什么,但是当我为我的 AngularJS 应用程序运行新的 Karma 测试时,我会从我的测试文件的先前版本中获得输出。我是 Karma 测试的新手,所以我确定我在某处遗漏了一些东西。

PhantomJS 2.1.1 (Windows 7 0.0.0) Calendar Constructor 实例化带有年、月和选项的日历 FAILED (这是我之前为此测试设置的输出)

当我的测试文件看起来像这样时,我不知道如何获得上述输出。

test.js

'use strict';

describe('holidays', function () {

    var scope, controller;

    beforeEach(function(){
        module('holiday');
    });

    describe('HolidaysController', function(){

        beforeEach(inject(function($rootScope, $controller){
            scope = $rootScope;
            controller = $controller('HolidaysController', {
                'vm': scope
            });
        }));

        it('should work', function(){
            expect(vm.tooltips).toBe(false);
        });
    });
});
  • Angular 版本:1.4.0
  • 业力版本:0.13.22
  • PhantomJS 版本: 2.1.1

【问题讨论】:

    标签: angularjs phantomjs karma-runner karma-jasmine


    【解决方案1】:

    我想通了,我打开了另一个终端,我之前曾在其中运行过 karma。关闭两个终端并重新打开一个后,问题就解决了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-04
      • 1970-01-01
      • 2018-10-04
      • 1970-01-01
      • 2014-09-20
      • 2013-05-15
      • 2019-02-17
      • 1970-01-01
      相关资源
      最近更新 更多