diff --git a/src/webgpu/web_platform/canvas/configure.spec.ts b/src/webgpu/web_platform/canvas/configure.spec.ts index 47c13e5eed28..06e590751b33 100644 --- a/src/webgpu/web_platform/canvas/configure.spec.ts +++ b/src/webgpu/web_platform/canvas/configure.spec.ts @@ -173,21 +173,21 @@ g.test('format') } } - t.expectValidationError(() => { + if (validFormat) { ctx.configure({ device: t.device, format, }); - }, !validFormat); - - const configuration = ctx.getConfiguration(); - t.expect(configuration!.format === format); - - t.expectValidationError(() => { - // Should always return a texture, whether the configured format was valid or not. - const currentTexture = ctx.getCurrentTexture(); - t.expect(currentTexture instanceof GPUTexture); - }, !validFormat); + const configuration = ctx.getConfiguration(); + t.expect(configuration!.format === format); + } else { + t.shouldThrow('TypeError', () => { + ctx.configure({ + device: t.device, + format, + }); + }); + } }); g.test('usage')