Я использую QUnit в MIT-лицензированном проекте, частично написанном на TypeScript.У меня есть некоторые функции TS, которые принимают QUnit в качестве параметра и хотят набрать их в качестве его интерфейса из набрав
Например:
import { QUnit } from "qunit";
export function run_tests(q: QUnit)
{
q.module((a) => { ... });
}
Однако, когда япопробуйте, я получаю эту ошибку:
tsc --project lib/typescript/www/tsconfig.json
src/ts/web-fc-solve-tests.ts(12,23): error TS2306: File '/home/shlomif/progs/fre
ecell/git/fc-solve/fc-solve/site/wml/node_modules/@types/qunit/index.d.ts' is no
t a module.
Вот мой код (обратите внимание на ветку): https://github.com/shlomif/fc-solve/tree/qunit-typescript - он находится в подкаталоге fc-solve/site/wml
.
Мой tsconfig.json
:
{
"compilerOptions": {
"baseUrl": ".",
"esModuleInterop": true,
"module": "amd",
"moduleResolution": "node",
"noImplicitReturns": true,
"outDir": "../../../lib/out-babel/js",
"paths": {
"big-integer": ["node_modules/big-integer/BigInteger.d.ts"],
"qunit": ["node_modules/@types/qunit"]
},
"target":"es6"
},
"include": ["../../../src/ts/**/*.ts"]
}
Спасибо за любую помощь.