Skip to content

Update setup instructions to be clear and add an example project #17

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

YetAnotherClown
Copy link

The current documentation provides setup instructions for Roblox Employees, this has been updated to provide usable examples for members of the community.

An example game has also been added in which the setup examples are used in, this provides a clear and usable example of how to use Jest Lua for a Roblox library.

Documentation now provides clear instructions on how to use Jest Lua
@YetAnotherClown YetAnotherClown changed the title Update setup instructions to be clear and add an example game Update setup instructions to be clear and add an example project Aug 30, 2024
Copy link
Member

@grilme99 grilme99 left a comment

Choose a reason for hiding this comment

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

Thank you for this! Requested some changes.

Comment on lines 108 to +118
Before you can run your tests, you need to enable the `debug.loadmodule` API. To do this, you must enable the `FFlagEnableLoadModule` flag. See issue [#3](https://github.com/jsdotlua/jest-lua/issues/3) for more.

To manage FastFlags for Studio, it is recommended that you use [Roblox Studio Mod Manager](https://github.com/MaximumADHD/Roblox-Studio-Mod-Manager) to set the `FFlagEnableLoadModule` FFlag to true. Or, you can edit your `ClientAppSettings.json` yourself.

```json title="ClientAppSettings.json"
{
"FFlagEnableLoadModule": true
}
```

Finally, run your project using Roblox Studio or `run-in-roblox` to run the tests and your tests should pass!
Finally, run your project using Roblox Studio or use [run-in-roblox](https://github.com/rojo-rbx/run-in-roblox) to run the tests and your tests should pass!
Copy link
Member

Choose a reason for hiding this comment

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

This isn't technically related to your PR, but debug.loadmodule is no longer necessary to run Jest, so that whole line can just be removed. Alternatively, you could add an info block that it is necessary in older versions.

run-in-roblox also isn't necessary anymore thanks to Open Cloud execution. Not sure if this is the best time to change that line though since we don't have a good out-of-the-box story for running Jest in Open Cloud yet. Thoughts?

Copy link
Author

Choose a reason for hiding this comment

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

Oh, that's cool. I didn't know debug.loadmodule was no longer needed, I guess I need to update my dependencies.

As for run-in-roblox, I think we leave it for now and decide again on this in the future. I do think we could expand the documentation and provide the different options users have for running Jest in the future though.

Copy link
Member

Choose a reason for hiding this comment

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

Could you change the example project to not be using Darklua? It complicates a minimal example and we'll also eventually be moving away from it for most Roblox code thanks to native string requires (though Jest doesn't support this yet.)

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