Skip to content

Commit

Permalink
fixed all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentBlanckaert committed Oct 26, 2024
1 parent 3e1b568 commit 9480ac3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
4 changes: 4 additions & 0 deletions tested/judge/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def run_command(
:return: The result of the execution if the command was not None.
"""
print(f"Running command {command} in {directory}")
print(f"Timeout: {timeout}")
print(f"Check: {check}")
print(f"Stdin: {stdin}")
if not command:
return None

Expand Down
18 changes: 7 additions & 11 deletions tested/languages/typescript/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,9 @@ def compilation(self, files: list[str]) -> CallbackResult:
if main_file:
return (
[
"tsc",
"--module",
"nodenext",
"--moduleResolution",
"nodenext",
"--noEmit",
"tsx",
"--tsconfig",
str(Path(__file__).parent / "tsconfig-compilation.json"),
main_file[0],
],
files,
Expand All @@ -125,8 +122,7 @@ def compilation(self, files: list[str]) -> CallbackResult:
return [], files

def execution(self, cwd: Path, file: str, arguments: list[str]) -> Command:
# Used es2022 because of the top-level await feature (most up-to data).
return ["tsx", "--tsconfig", str(Path(__file__).parent / "tsconfig.json"), file, *arguments]
return ["tsx", file, *arguments]

def modify_solution(self, solution: Path):
# import local to prevent errors
Expand All @@ -138,10 +134,10 @@ def modify_solution(self, solution: Path):
output = run_command(
solution.parent,
timeout=None,
command=["tsx", "--tsconfig", str(Path(__file__).parent / "tsconfig.json"), parse_file, str(solution.absolute())],
check=False,
command=["tsx", parse_file, str(solution.absolute())],
check=True,
)
print(output.stderr)
print(output)
assert output, "Missing output from TypesScript's modify_solution"
namings = output.stdout.strip()
with open(solution, "a") as file:
Expand Down
19 changes: 19 additions & 0 deletions tested/languages/typescript/tsconfig-compilation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "esnext",
"strict": true,
"target": "es6",
"moduleDetection": "force",
"resolveJsonModule": true,
"allowJs": true,
"esModuleInterop": true,
"skipLibCheck": true,
"isolatedModules": true,
"verbatimModuleSyntax" : true,
"types" : ["node"],
"moduleResolution" : "node",
"allowImportingTsExtensions" : true,
"noEmit" : true
},

}
2 changes: 1 addition & 1 deletion tested/languages/typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"moduleDetection": "force",
"resolveJsonModule": true,
"allowJs": true,
"esModuleInterop": true,
"esModuleInterop": true,
"skipLibCheck": true,
"isolatedModules": true,
"verbatimModuleSyntax" : true,
Expand Down

0 comments on commit 9480ac3

Please sign in to comment.