diff --git a/tested/languages/typescript/config.py b/tested/languages/typescript/config.py index d5e9831f..ee9ad819 100644 --- a/tested/languages/typescript/config.py +++ b/tested/languages/typescript/config.py @@ -128,7 +128,7 @@ def modify_solution(self, solution: Path): solution.parent, timeout=None, command=["tsx", parse_file, str(solution.absolute())], - check=False, + check=True, ) assert output, "Missing output from TypesScript's modify_solution" namings = output.stdout.strip() diff --git a/tests/exercises/echo-function-additional-source-files/solution/correct.ts b/tests/exercises/echo-function-additional-source-files/solution/correct.ts index 40bad740..cd443043 100644 --- a/tests/exercises/echo-function-additional-source-files/solution/correct.ts +++ b/tests/exercises/echo-function-additional-source-files/solution/correct.ts @@ -1,4 +1,4 @@ -const e = require("./echo.ts"); +import * as e from "./echo.ts"; function echo(content) { return e.echo(content); diff --git a/tests/exercises/echo-function-additional-source-files/workdir/echo.ts b/tests/exercises/echo-function-additional-source-files/workdir/echo.ts index 3bb749dc..f8f72077 100644 --- a/tests/exercises/echo-function-additional-source-files/workdir/echo.ts +++ b/tests/exercises/echo-function-additional-source-files/workdir/echo.ts @@ -2,4 +2,4 @@ function echo(content) { return content; } -module.exports = { echo }; +export { echo }; diff --git a/tests/exercises/echo-function-file-input/solution/correct.ts b/tests/exercises/echo-function-file-input/solution/correct.ts index 87e768a3..b9added1 100644 --- a/tests/exercises/echo-function-file-input/solution/correct.ts +++ b/tests/exercises/echo-function-file-input/solution/correct.ts @@ -1,4 +1,4 @@ -const fs = require('fs'); +import * as fs from 'fs'; function echoFile(content) { return fs.readFileSync(content, {encoding:'utf8', flag:'r'}).trim(); diff --git a/tests/exercises/echo-function-file-output/solution/correct.ts b/tests/exercises/echo-function-file-output/solution/correct.ts index da5cfb3d..e7bacf3d 100644 --- a/tests/exercises/echo-function-file-output/solution/correct.ts +++ b/tests/exercises/echo-function-file-output/solution/correct.ts @@ -1,4 +1,4 @@ -const fs = require('fs'); +import * as fs from 'fs'; function echoFunction(filename, stringToWrite) { fs.writeFileSync(filename, stringToWrite + '\n', { flag: 'w' }); diff --git a/tests/exercises/isbn/evaluation/one-with-crashing-assignment-typescript.tson b/tests/exercises/isbn/evaluation/one-with-crashing-assignment-typescript.tson index 09f8546d..35c7d006 100644 --- a/tests/exercises/isbn/evaluation/one-with-crashing-assignment-typescript.tson +++ b/tests/exercises/isbn/evaluation/one-with-crashing-assignment-typescript.tson @@ -7,8 +7,8 @@ "contexts": [ { "before": { - "java": { - "data": "Supplier> ex = () -> {throw new AssertionError();};" + "typescript": { + "data": "const ex: () => Array = () => {throw new Error("AssertionError");};" } }, "testcases": [ diff --git a/tests/test_linters.py b/tests/test_linters.py index 00db95ec..3497d84b 100644 --- a/tests/test_linters.py +++ b/tests/test_linters.py @@ -56,6 +56,7 @@ def test_eslint(tmp_path: Path, config: dict, pytestconfig: pytest.Config): config, ) result = execute_config(conf) + print(conf) updates = assert_valid_output(result, pytestconfig) assert len(updates.find_all("annotate-code")) > 0 diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index ed93465f..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "ts-node/node16/tsconfig.json", - "compilerOptions" : { - "esModuleInterop" : true, - "module" : "ESNext", - "moduleResolution" : "node", - "allowImportingTsExtensions" : true, - "types" : ["node"], - }, - "ts-node" : { - "esm" : true, - "transpileOnly": true, - "experimentalSpecifierResolution" : "node" - } -}