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

Deno Test Internal Data Access #27394

Open
acrodrig opened this issue Dec 17, 2024 · 0 comments
Open

Deno Test Internal Data Access #27394

acrodrig opened this issue Dec 17, 2024 · 0 comments

Comments

@acrodrig
Copy link

I have a suite of tests that I am interested in running every 24H, but not earlier than that (unless the last run failed).

The reason for that is that they are expensive (both computationally and monetarily as they access paying services).

My current strategy is hacky:

  1. On the last test of the suite, store the date on localStorage with import.meta.filename as the key
  2. At the beginning of the test, check the date and if less than 24, set const ignore to true
  3. Add { ignore: ignore } to all tests so that they are ignored if 24H have not gone by
  4. Not forget to add --fail-fast (so that the date is NOT stored on failure)

As you can see, many things can go wrong with this approach.

I know that I could set a scheduler to run it every 24H or something like that, but I do not want to reach for "cron" oriented solutions.

My ask is to have access to the current suite of tests. How many have passed? How many have failed? Having read-only access to this info in user land could enable me to not depend on --fail-fast. And it would be nice to have a beforeAll afterAll without the additional structure of building steps.

Cheers.

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

1 participant