cloudflare-typescript-workers
cloudflare-typescript-workers copied to clipboard
Types and mocks for building a tested Typescript Cloudflare Worker, generates three NPM packages
I'm trying to test code that does something like `crypto.subtle.digest('MD5', body)`. However, when I run the test, I get the error `ReferenceError: crypto is not defined`. Do the mocks need...
Hey, folks! Given that Cloudflare seems to actively support typings for workers now: https://github.com/cloudflare/workers-types, do you have any plans on syncing/migrating to the "official" typings? Thanks for amazing work here...
The `KV.list()` method signature according to the [docs](https://developers.cloudflare.com/workers/runtime-apis/kv#listing-keys) is: ```js NAMESPACE.list({prefix?: string, limit?: number, cursor?: string}) ``` This solution seems correct to resolve #27 but I'm not 100% about it....
I have some test code that sets up a mock response like this: fetchMock.mockResponse('', { headers: { 'Content-Type': 'text/html' }, status: 404 }) However, I noticed that my tests that...
https://github.com/udacity/cloudflare-typescript-workers/blob/57171c327149e48e85e1ad26cfe6fc4c485fa68f/packages/types-cloudflare-worker/src/global.ts#L668 The issue is with the list method signature (which is actually correct in the docblock above it). `NAMESPACE.list({prefix?: string, limit?: number, cursor?: string})` If I call the list method...
https://github.com/microsoft/TSJS-lib-generator/issues/729 has been resolved, which means #5 can be reverted, when the new typings are available upstream. Probably the next TS point release.
It appears that cloudflare-worker-mock has a dependency on @udacity/types-service-worker-mock, which is not listed as a dependency in the package.json. Requiring the module in JS gives this error: ```sh Error: Cannot...