Skip to content

Commit

Permalink
test: add an additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
wessberg committed Jul 23, 2022
1 parent 48cc047 commit b67b873
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/interpreter/util/node/find-nearest-parent-node-of-kind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,3 @@ export function getStatementContext<T extends TS.Declaration = TS.Declaration>(f
}
}
}

/**
* TODO: You could in principle use the information from the environment preset
* to resolve bindings from built-in node modules


else if (typescript.isImportDeclaration(nextNode)) {
return false;
} else if (typescript.isNamespaceImport(nextNode)) {
return false;
} else if (typescript.isNamedImports(nextNode)) {
return false;
} else if (typescript.isImportSpecifier(nextNode)) {
return false;
}*/
14 changes: 14 additions & 0 deletions test/error-handling/error-handling.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import test from "ava";
import {executeProgram} from "../setup/execute-program.js";
import {withTypeScript} from "../setup/ts-macro.js";

test("Errors will be caught and set as the 'reason' property on returned values. #1", withTypeScript, (t, {typescript, useTypeChecker}) => {
t.notThrows(() => executeProgram(
// language=TypeScript
`
const foo = require("./somethingthatdoesnotexist.js");
`,
"foo",
{typescript, useTypeChecker}
));
});

0 comments on commit b67b873

Please sign in to comment.