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

Compile expect.extend as a callback #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

xeqi
Copy link

@xeqi xeqi commented Jul 30, 2023

TestEz uses a metatable on a new object to wrap its ExpectationContext, so that extend is a callback.
https://github.com/Roblox/testez/blob/26a5247631279154c74425b94583c189b8447d0f/src/TestRunner.lua#L19

Pre-commit code will result in the following error when ran:

ReplicatedStorage.rbxts_include.node_modules.@rbxts.testez.src.ExpectationContext:32: Cannot overwrite matcher "extend"; it already exists
ReplicatedStorage.rbxts_include.node_modules.@rbxts.testez.src.ExpectationContext:32 function extend
ReplicatedStorage.rbxts_include.node_modules.@rbxts.testez.src.TestRunner:22 function extend

TestEz uses a metatable on a new object to wrap its `ExpectationContext`, so that `extend` is a callback. 
 https://github.com/Roblox/testez/blob/26a5247631279154c74425b94583c189b8447d0f/src/TestRunner.lua#L19

Pre-commit code will result in the following error when ran:

```
ReplicatedStorage.rbxts_include.node_modules.@rbxts.testez.src.ExpectationContext:32: Cannot overwrite matcher "extend"; it already exists
ReplicatedStorage.rbxts_include.node_modules.@rbxts.testez.src.ExpectationContext:32 function extend
ReplicatedStorage.rbxts_include.node_modules.@rbxts.testez.src.TestRunner:22 function extend
```
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.

1 participant