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

Miniflare jest env #2

Merged
merged 57 commits into from
Jan 17, 2024
Merged

Miniflare jest env #2

merged 57 commits into from
Jan 17, 2024

Conversation

jrhender
Copy link
Owner

@jrhender jrhender commented Jun 4, 2023

Using miniflare jest env (https://miniflare.dev/testing/jest) to run tests on CF worker code.

TODO:

  • ensure that latest code is being tested (as it seems to be the built CF worker file that is executed)
  • add script for generating test data
  • write README on how to use the script
  • parameterize the test to run for each result of the mock data
  • share the same question ids between the script and the test (was too challenging to get the compilation to work)

tsconfig.json Outdated
@@ -2,7 +2,7 @@
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"skipLibCheck": true,
"lib": ["DOM", "DOM.Iterable", "ES2019"],
"lib": ["DOM", "DOM.Iterable", "ES2020"],
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to add this change because of miniflare test env, I believe. Need to double check that this change is needed

This required moving coda URL generation to separate file.
Otherwise, compilation of refresh script fails due to missing CF vars
Need to refactor stampy.ts further to use.
Would want to have more tests befoe this refactor.
revert previous addition of dev:build
add "npm run build" to test command
build is needed before test because tests on running on build
@jrhender jrhender merged commit 73f96b1 into master Jan 17, 2024
1 check passed
@jrhender jrhender deleted the miniflare-jest-env branch January 17, 2024 21:46
jrhender pushed a commit that referenced this pull request Feb 14, 2024
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