I guess maybe it hasn't rolled out to my account yet or something, I'll have to try later. I am hype
I guess maybe it hasn't rolled out to my account yet or something, I'll have to try later. I am hyped to look at it though
[object Object]./cfrole command to get the official employee role? It'll make it more clear you're part of the team@lumenize/testing which builds on cloudflare:test vitest integration. See: https://lumenize.com/docs/testing/usage#basic-usage. Example:json-rpc-mixin so this is a prefect time for the release. Will definitely take a lookjson-rpc-mixin package with my advanced CORS supporting routeDORequest. I recommend the whitelist approach. See: https://lumenize.com/docs/utils/route-do-request#cors-supportrouteAgentRequest which is what json-rpc-mixin shows using in the docs has all or nothing CORS support. The third parameter is a config object and { cors: true } will allow all cross origins.json-rpc-mixin and onto lumenize anyway so that I can remove the agents dependency, but good to knowagents SDK isn't documented anywhere in the docs except for the changelog where it was introducedagents. The team has traditionally not consider docs (or quality, responsiveness on Discord, etc.) important although they say they are working on improving them. Also, it must be said that they have always had a great API design, even if you have to crawl in the code to discern it.{ cors: false} default and { cors: true } allow everything, are accurate for routeAgentRequest but I recommend strongly against using if you are using WebSockets. They don't support the whitelist or custom validation function modes that mine does.@lumenize/testingcloudflare:testjson-rpc-mixinjson-rpc-mixinjson-rpc-mixinjson-rpc-mixinrouteDORequestrouteAgentRequest{ cors: true }{ cors: true }lumenizeagentsagentsagents{ cors: false}it('shows basic 5-step test', async () => {
// 1. Create RPC testing client and Browser instance
await using client = createTestingClient<MyDOType>('MY_DO', '5-step');
const browser = new Browser();
// 2. Pre-populate storage via RPC to call asycn KV API
await client.ctx.storage.put('count', 10);
// 3. Make a fetch and RPC call to increment
const resp = await browser.fetch('https://test.com/my-do/5-step/increment');
const rpcResult = await client.increment();
// 4. Confirm that results are as expected
expect(await resp.text()).toBe('11');
expect(rpcResult).toBe(12); // Notice this is a number not a string
// 5. Verify that storage is correct via RPC
expect(await client.ctx.storage.kv.get('count')).toBe(12);
});