ng测试成功-在Linux上应与不匹配的任何签名断开

ng测试成功-在Linux上应与不匹配的任何签名断开,linux,angular,unit-testing,Linux,Angular,Unit Testing,我刚刚注意到我目前正在做的一个项目有些奇怪。为了确保它没有链接到我的项目,我使用Angular CLI从头开始创建了一个新的。 当运行ng测试时我得到了成功的结果,但是一旦我保存而没有任何更改我的规范文件,我就得到了预期的错误: ERROR in /home/.../my-app/src/app/my-component/my-component.component.spec.ts (24,16): Supplied parameters do not match any signature o

我刚刚注意到我目前正在做的一个项目有些奇怪。为了确保它没有链接到我的项目,我使用Angular CLI从头开始创建了一个新的。 当运行ng测试时我得到了成功的结果,但是一旦我保存而没有任何更改我的规范文件,我就得到了预期的错误:

ERROR in /home/.../my-app/src/app/my-component/my-component.component.spec.ts (24,16): Supplied parameters do not match any signature of call target.
以下是我的CLI版本:

@angular/cli: 1.0.2
node: 6.10.2
os: linux x64
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.2
@angular/compiler-cli: 4.1.3
以下是重现此问题的步骤:

ng new my-app
cd my-app
ng g component my-component
ng g class my-class userModel
用户模型如下所示:

export class UserModel {
  constructor(
    public name: string,
    public age: number,
    public gender: string
  ) {}
}
然后我只需更新my-component.component.spec

import { UserModel } from './../userModel';
.
.
.
it('should create', () => {
  let user = new UserModel('name', 42);
  expect(component).toBeTruthy();
});
我知道我应该用3个参数调用UserModel(VSCode甚至会突出显示缺少的参数),这正是我想要测试的。我想确保,如果我创建了一个新对象,并且签名不匹配,那么问题从一开始就被提出了

奇怪的是,在我的另一台运行Windows的计算机上,当我运行ng test时,结果正如预期的那样失败

我不确定这是否与angular cli、jasmine或karma有关,也不确定这是否是一个真正的bug或可能来自我电脑的东西

非常感谢你的帮助