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

Run tests in dev mode #234

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Run tests in dev mode #234

wants to merge 8 commits into from

Conversation

vocksel
Copy link
Collaborator

@vocksel vocksel commented Jan 1, 2024

Problem

Tests can only be run manually via ./bin/test.sh which is usually good enough, but it would be helpful to have tests run when files are changed

Solution

Tests are now run in Studio when using the dev project, and when using an accompanying build and watch command this will allow tests to run on file changes

To get this all working I've made some pretty extensive changes:

  • Added a new DEV_MODE BoolValue to replace constants.IS_DEV_MODE. This BoolValue is only set in dev.project.json
  • Updated tests for useZoom, useDescendants, useEvent, and stores.spec.lua to get everything passing in Studio
  • stories.spec.lua was tricky, and I wound up creating a bunch of helper functions for the discovery and loading of storybooks and stories. With tests!

Also some other minor changes I made are:

  • Made Luau LSP aware of our TestEZ type defs so there are no more red squiggles in vscode
  • Removed the allow rule for global_usage

Checklist

  • Ran ./bin/test.sh locally before merging

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