forked from StampyAI/stampy-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This wasn't the case before running the tests in miniflare jest env. So maybe it is related to miniflare somehow
Undici is what is provided OOTB from miniflare for fetch mocking. https://miniflare.dev/testing/jest#mocking-outbound-fetch-requests
jrhender
force-pushed
the
miniflare-jest-env
branch
from
June 18, 2023 21:19
8fadee2
to
4209c64
Compare
jrhender
commented
Jun 21, 2023
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"], |
There was a problem hiding this comment.
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
tsconfig is to allow for isolated modules
jrhender
force-pushed
the
miniflare-jest-env
branch
from
July 4, 2023 20:48
cc6d2b9
to
70b465d
Compare
can't compile stampy.ts without CF env available
Not needed for now
Trying to avoid merge conflicts
jrhender
force-pushed
the
miniflare-jest-env
branch
from
July 27, 2023 07:28
127606a
to
040edbd
Compare
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
force-pushed
the
miniflare-jest-env
branch
from
August 12, 2023 16:12
d9248c7
to
7e35416
Compare
Was previously just getting question detail. Now, answers, tags, banners are cached. stampy.spec is now mocking all requests in the cached data.
better to have in a separate PR IMO
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using miniflare jest env (https://miniflare.dev/testing/jest) to run tests on CF worker code.
TODO:
share the same question ids between the script and the test(was too challenging to get the compilation to work)