Repository navigation
test: add downloads, export, and type contracts - #227
Draft
derekmeegan wants to merge 2 commits into
Draft
derekmeegan wants to merge 2 commits into
derekmeegan wants to merge 2 commits into
Conversation
Moved from browserbase-stlc-config, where they ran against the generated output before custom code was applied. Here they run in this repo's CI: jest picks up the two test files and ./scripts/lint type-checks sdk-types.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default Node runtime uses native fetch, so node-fetch's Response fails the generated instanceof checks, as in every other resource test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
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.
Moves the Node SDK contract tests from browserbase/browserbase-stlc-config#39 into this repo's CI, for the one-repo flow.
tests/lib/downloads.test.tscovers downloads pagination, metadata, deletion, errors, the legacy ZIP endpoint, streaming with backpressure, empty files, and aborts. Every case runs twice: under the default native fetch and undernode-fetch.tests/lib/exports.test.tscovers the default and named exports, the resource classes (now includingDownloads), the error classes, and the utilities.tests/lib/sdk-types.tsis the type-level contract. It isn't a jest file;./scripts/linttype-checks it.This is stacked on
feat/downloads, the preview build of browserbase/browserbase-stlc-config#75. Retarget it tomainafter #75 merges, then merge this right away: until then,main's CI fails the generated downloads test.One edit to a generated file. The second commit makes
tests/api-resources/downloads.test.tsimportResponsefrom the SDK shim instead ofnode-fetch. Every other resource test already carries this as a sealed patch. Without it, the preview's CI fails that file three times with "Expected constructor: Response", because the default Node runtime uses native fetch. The release-sdk skill says never to edit generated files, so if there's a better fix, I'll drop this commit.What's lost from the config-repo version. The export checks now run against
srcthrough jest's module mapping, not against the built package. So the CommonJSmodule.exportsshape is no longer asserted../scripts/buildstill smoke-testsrequireandimportofdist.Locally,
./scripts/lintpasses, and./scripts/testpasses all 208 tests against the mock server.🤖 Generated with Claude Code