打包文件库未包含在编译/类型检查Mocha测试中

时间:2017-05-11 14:47:00

标签: javascript typescript mocha ts-node

尝试使用Typescript声明的类型"文件"我的Mocha测试中的(lib.dom.d.ts)(见下文),当ts-node使用tsconfig.json文件编译时,没有包含/检查相应的库。

我在" lib"中引用了es6和dom库。 tsconfig.json数组(它们都有一个声明的File类型)。 (我已经验证正在使用tsconfig.json,并且没有其他tsconfig.json)

- ERROR -

Arquillian

- NPM脚本 -

ReferenceError: File is not defined

- 测试--- `

"mocha --compilers ts:ts-node/register tests/**/*.tests.ts"

`

- tsconfig.json - `

  describe("SendFile Endpoint", () => {
       const file = new File(["test"], "filename"); //< -- File ref
       const formData: FormData;
       const error = new Error("error occurred sending file");
       const responseString = JSON.stringify({postId: 1});
       .....

`

0 个答案:

没有答案