Skip to content

test(test-renderer): cover the equirect background path in the mock GL contract test - #3866

Open
ShreeBohara wants to merge 1 commit into
pmndrs:v10from
ShreeBohara:test/3845-equirect-background
Open

test(test-renderer): cover the equirect background path in the mock GL contract test#3866
ShreeBohara wants to merge 1 commit into
pmndrs:v10from
ShreeBohara:test/3845-equirect-background

Conversation

@ShreeBohara

Copy link
Copy Markdown

Closes #3845.

#3821's source change was superseded by #3822. This is the half you asked to keep.

What it covers. The existing assertions call the mock directly. This case renders an equirect background through three, which resolves through PMREMGenerator and binds a framebuffer-backed render target, so WebGLState.drawBuffers() receives a handle the mock actually produced.

It discriminates. Against the pre-#3822 () => {} stub it fails with TypeError: Invalid value used as weak map key — the #3820 error, raised synchronously rather than as a flake. It passes on current v10.

Placement. Added to WebGL2RenderingContext.test.ts rather than restoring RTTR.webgl2.test.ts as its own file. You offered either. The other two tests in my original file — WeakMap-keyability and distinct-per-call — are already covered by your contract test, so a separate file would have been mostly duplication. Happy to split it out if you'd rather it stand alone.

Full suite: 48 files, 606 passed. Coverage 81.32% lines, against the 78 threshold.

Not fixed here: createVertexArrayOES in the getExtension object still returns undefined. Same class of bug, different path, and the WebGL2 render path never reaches it — out of scope for this.

…L contract test

The contract assertions poke the mock directly. This adds the case from pmndrs#3821 that
drives the path pmndrs#3820 actually broke: an equirect background resolves through
PMREMGenerator, which binds a framebuffer-backed render target, so three reaches
WebGLState.drawBuffers() with a handle the mock produced.

Verified it discriminates: against the pre-pmndrs#3822 `() => {}` stub it fails with
"TypeError: Invalid value used as weak map key", the original pmndrs#3820 error.

Closes pmndrs#3845

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant