Skip to content

Remove legacy test utils#957

Merged
Perryvw merged 10 commits intoTypeScriptToLua:masterfrom
lolleko:remove-legacy-test-utils
Feb 6, 2021
Merged

Remove legacy test utils#957
Perryvw merged 10 commits intoTypeScriptToLua:masterfrom
lolleko:remove-legacy-test-utils

Conversation

@lolleko
Copy link
Copy Markdown
Member

@lolleko lolleko commented Dec 27, 2020

Removed legacy test utils and replaced all remaining usages with TestBuilder. I tried to use expectJSResult() whenever possible.

Also improved support for multi file tests TestBuilder.addExtraFile now works for all the different factories (testBundle, testModule, testFunction, testExpression ...):

  • In Lua this is achieved by loading extra files into packages.loaded via the Lua API.
    This mechanism is now also used to inject our test dependencies (lualib & JSON.Stringify).

  • In JS a custom require in conjunction with node's vm module is used. The JS setup is a bit hacky at the moment (global support is basic and import hoisting does not work). This can be approved significantly once https://nodejs.org/api/vm.html#vm_class_vm_module becomes stable.

Needs very thorough review, because this could potentially break tests.

@lolleko lolleko marked this pull request as ready for review January 26, 2021 22:29
Copy link
Copy Markdown
Collaborator

@tomblind tomblind left a comment

Choose a reason for hiding this comment

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

Looks good. I'm not seeing anything that should mess with test results.

@Perryvw Perryvw merged commit 8578376 into TypeScriptToLua:master Feb 6, 2021
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.

3 participants