使用 ts-jest,得到 `error TS2554: Expected 0 arguments, but got 1` for constructor

Using ts-jest, getting `error TS2554: Expected 0 arguments, but got 1` for constructor

这很奇怪。我刚刚回到 TypeScript,我正在尝试做一些 TDD。我进行了 ts-jest 设置并 运行 进行了测试,但我已经 运行 遇到了一些非常简单的问题,我无法弄清楚。

organization.ts:

class Organization implements IOrganization {
    id: Id;
    name: string;

    constructor(name: string) {
        this.name = name;
    }
}


export default Organization;

test.ts:

import Organization from "./organization";
import Simulation from "./simulation";

it('stores the user organization', () => {
    let userOrganization = new Organization("does not matter");
}

VS Code 没有对我大喊大叫,但是当我尝试 运行 ts-jest 时,我在构造函数中得到了 error TS2554: Expected 0 arguments, but got 1。我一定遗漏了一些明显的东西。

原来我排除了 *test.ts* in mytsconfig.jsonper the TypeScript example, which I guess meant thatts-jest` 并没有把它们捡起来。删除该排除项后,一切正常。感谢 Yannick Meeus 帮我解决了这个问题。