Skip to content
File

Blob: src/cloudflare/internal/test/br/br-api-test.js

javascript22 lines
1// Copyright (c) 2025 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4 
5import * as assert from 'node:assert';
6 
7export const tests = {
8 async test(_, env) {
9 {
10 // Test legacy fetch
11 const resp = await env.browser.fetch('http://workers-binding.brapi/run', {
12 method: 'POST',
13 headers: { 'content-type': 'application/json' },
14 body: JSON.stringify({
15 inputs: { test: true },
16 }),
17 });
18 assert.deepStrictEqual(await resp.json(), { success: true });
19 }
20 },
21};