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

Readme section on how to run the tests #108

Open
Neppord opened this issue Jun 12, 2024 · 2 comments
Open

Readme section on how to run the tests #108

Neppord opened this issue Jun 12, 2024 · 2 comments

Comments

@Neppord
Copy link

Neppord commented Jun 12, 2024

From looking into the github workflow file I assume it is something like this:

spago test --purs-args '--censor-lib'

But it would be nice to have a more detailed explanation, or a npm test target.

@jam-awake
Copy link
Collaborator

jam-awake commented Jun 12, 2024

I forget how to pass CLI args into spago-legacy (is it --exec-args?), so any additional things after spago test should be passed in. From the root directory, you would run spago test. For context, if you cd backend-es && npm run test, that's where the test files live.

By default,spago test will run all tests, comparing the outputted snapshots with the saved ones, and failing if any don't match. There are 3 CLI args you can pass to the Test.Main program:

  • --filter "ModuleName" - only run tests that are prefixed with Snapshot.ModuleName
  • --accept - Overwrite all saved snapshot files with the newly outputted ones
  • --trace-rewrites Fully.Qualified.Module.Name - Output the steps of optimizations done by the optimizer when building the given module. Useful for troubleshooting why something did or didn't inline correctly.

@Neppord
Copy link
Author

Neppord commented Jun 12, 2024

I didn't see the package.json file in the subfolder, only the one in the root folder.

Now when I understand that there are two, then it's obvius how to run the tests. But it still seams like a good idea with instructions in the readme.

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

No branches or pull requests

2 participants