Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added test to validate that js file is used over invalid TS file #18

Merged
merged 2 commits into from
Jun 29, 2022

Conversation

jmplexi
Copy link
Contributor

@jmplexi jmplexi commented Jun 28, 2022

Summary

Added a new test to verify that load-function-module will load a js file over a bad ts file. #16

Requirements (place an x in each [ ])

Copy link
Collaborator

@shapirone shapirone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This handles the Validates that it'll use the existing js file over a ts file that doesn't exist. case but we also need to add a test to cover Validates that a ts file will be used instead of a js file when they both exist.

@@ -31,6 +31,21 @@ Deno.test("LoadFunctionModule function", async (t) => {
);
});

await t.step("should load the js file if ts file is invalid", async () => {
const tsModule = await LoadFunctionModule(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This results in a jsModule rather than a tsModule

assertEquals(
tsModule.default.name,
"wackyJS",
"typescript file invalid, js file loaded",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a Custom Error Message in case this assertion doesn't work. Right now this reads like a success message.

Copy link
Collaborator

@shapirone shapirone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉 as we talked about, we can tackle that other test case in a separate PR since the actual logic isn't implemented yet 😬

@jmplexi jmplexi merged commit 3368ab2 into main Jun 29, 2022
@jmplexi jmplexi deleted the validate-load-function-test branch June 29, 2022 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants