flipbook icon indicating copy to clipboard operation
flipbook copied to clipboard

Run tests in dev mode

Open vocksel opened this issue 1 year ago • 0 comments

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

vocksel avatar Jan 01 '24 18:01 vocksel