-
Notifications
You must be signed in to change notification settings - Fork 9
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
Initial test around stampy.ts #276
Conversation
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
tsconfig is to allow for isolated modules
can't compile stampy.ts without CF env available
Not needed for now
Trying to avoid merge conflicts
@Aprillion I think all of the comments from your first review have been addressed. Please give the PR another review when you have the opportunity (no rush at all 😄 ). |
@Aprillion The PR is ready for review again when you have time. No rush. |
better to have in a separate PR IMO
Hey @Aprillion, no rush, but just checking in here. What would you say the next steps for this PR would be? Are there additional reviews or changes required? |
oh, GH actions needed some extra approval, not just PR approval.. the merge button should get enabled after the checks run I hope.. |
@jrhender one of the tests failed in https://github.com/StampyAI/stampy-ui/actions/runs/6245510948/job/17457463802?pr=276#step:3:139 |
@Aprillion could you approval the workflow again when you have a moment please? |
Whoops, sorry, I guess it needs to be reviewed again as well as I updated the cached coda data in the last commit: 30845a9 |
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.
the tests are green for me locally too, no idea why it fails in the GH actions of the main repo 🤔
let's try to merge and see if the tests will start working for next PR - and if now, we will disable and investigate later 🤷
ok, the test passed for PR #337 => https://github.com/StampyAI/stampy-ui/actions/runs/6439654334/job/17487581099?pr=337 😌 |
This PR uses the miniflare jest env (https://miniflare.dev/testing/jest) to run a test on code that has a dependency on CF workers, in this case
server-utils/stampy.ts
.The new test, in
stampy.spect.ts
, relies on a data which is stored in the repository in themocks
directory.The data can be refreshed manually by running
npm run refresh-test-data
.The only app code change (other than new exports) a cut-paste of Coda URL generation from
stampy.ts
to a separate file. Other wise, compilation of the refresh coda data script fails due to missing CF vars (e.g.CODA_TOKEN
).TODO:
share the same question ids between the script and the test(was too challenging to get the compilation to work)Relates to issue #191