You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If someone wants to create tests for their scripts, there doesn't seem to be a way to easily configure jest/vitest to run those tests. The test file(s) in /scripts are ignored.
You can trick them into running with the following command:
yarn rw test --projects scripts *
You see a warning printed quickly:
● Validation Warning:
Unknown option "projects" with value ["<rootDir>/{*,!(node_modules)/**/}/jest.config.js"] was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration
Then the actual test files will run and work. You see a big "Active Filters" list of files that we must be adding behind the scenes:
Test Suites: 2 passed, 2 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 0.335 s
Ran all test suites matching /README.md|graphql.config.js|jest.config.js|node_modules|package.json|prettier.config.js|redwood.toml|scripts|select.sql|yarn.lock/i.
Active Filters: filename /README.md|graphql.config.js|jest.config.js|node_modules|package.json|prettier.config.js|redwood.toml|scripts|select.sql|yarn.lock/
› Press c to clear filters.
But ideally we should just run them automatically with just plain yarn rw test. This should really work for any top-level directory you create outside of web and api.
How do we reproduce the bug?
Create a new Redwood app
Create a test file in the /scripts directory of an app
Run yarn rw test
What's your environment? (If it applies)
No response
Are you interested in working on this?
I'm interested in working on this
The text was updated successfully, but these errors were encountered:
What's not working?
If someone wants to create tests for their scripts, there doesn't seem to be a way to easily configure jest/vitest to run those tests. The test file(s) in
/scripts
are ignored.You can trick them into running with the following command:
You see a warning printed quickly:
Then the actual test files will run and work. You see a big "Active Filters" list of files that we must be adding behind the scenes:
But ideally we should just run them automatically with just plain
yarn rw test
. This should really work for any top-level directory you create outside ofweb
andapi
.How do we reproduce the bug?
/scripts
directory of an appyarn rw test
What's your environment? (If it applies)
No response
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: