Skip to content

Commit

Permalink
rewrote some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentBlanckaert committed Oct 24, 2024
1 parent f040248 commit 0d1c9c6
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion tested/languages/typescript/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const e = require("./echo.ts");
import * as e from "./echo.ts";

function echo(content) {
return e.echo(content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ function echo(content) {
return content;
}

module.exports = { echo };
export { echo };
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fs = require('fs');
import * as fs from 'fs';

function echoFunction(filename, stringToWrite) {
fs.writeFileSync(filename, stringToWrite + '\n', { flag: 'w' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"contexts": [
{
"before": {
"java": {
"data": "Supplier<List<Object>> ex = () -> {throw new AssertionError();};"
"typescript": {
"data": "const ex: () => Array<any> = () => {throw new Error("AssertionError");};"
}
},
"testcases": [
Expand Down
1 change: 1 addition & 0 deletions tests/test_linters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 0 additions & 15 deletions tsconfig.json

This file was deleted.

0 comments on commit 0d1c9c6

Please sign in to comment.