Skip to content

Commit

Permalink
cleaned up code some more and turned off throwing of errors for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentBlanckaert committed Oct 24, 2024
1 parent 55bbfa1 commit 01ad38a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tested/languages/typescript/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,11 @@ def modify_solution(self, solution: Path):
solution.parent,
timeout=None,
command=["tsx", parse_file, str(solution.absolute())],
check=True,
check=False,
)
assert output, "Missing output from TypesScript's modify_solution"
namings = output.stdout.strip()
with open(solution, "a") as file:
# print(f"\ndeclare var module: any;", file=file)
print(f"\nexport {{{namings}}};", file=file)

# Add strict mode to the script.
Expand Down
4 changes: 2 additions & 2 deletions tested/languages/typescript/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _generate_internal_context(ctx: PreparedContext, pu: PreparedExecutionUnit)
if not ctx.context.has_main_testcase():
result += f"""
writeSeparator();
//delete require.cache[require.resolve("./{submission_file(pu.language)}")];
delete require.cache[require.resolve("./{submission_file(pu.language)}")];
let {pu.submission_name} = await import('./{submission_file(pu.language)}');
"""

Expand Down Expand Up @@ -192,7 +192,7 @@ def _generate_internal_context(ctx: PreparedContext, pu: PreparedExecutionUnit)
if tc.testcase.is_main_testcase():
assert isinstance(tc.input, MainInput)
result += f"""
//delete require.cache[require.resolve("./{pu.submission_name}.ts")];
delete require.cache[require.resolve("./{pu.submission_name}.ts")];
let {pu.submission_name} = await import('./{pu.submission_name}.ts');
"""
else:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-ignore
import * as e from "./echo.ts";

function echo(content) {
Expand Down

0 comments on commit 01ad38a

Please sign in to comment.