MCPcopy Create free account
hub / github.com/cfworker/cfworker / assertBundlesJavaScriptWorker

Function assertBundlesJavaScriptWorker

packages/dev/test/run-command.spec.js:8–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6const port = 7000;
7
8export async function assertBundlesJavaScriptWorker() {
9 const entry = './test/fixtures/worker.js';
10 const code = `
11 import { status } from './status.js';
12 addEventListener('fetch', e => e.respondWith(new Response('', { status })));`;
13 await fs.outputFile(entry, code);
14 await fs.outputFile(
15 './test/fixtures/status.js',
16 'export const status = 200;'
17 );
18 const command = new RunCommand({
19 entry,
20 port,
21 inspect: false,
22 watch: false,
23 check: false,
24 kv: []
25 });
26 await command.execute();
27 const response = await fetch('http://localhost:7000');
28 assert.equal(response.status, 200);
29 command.dispose();
30}
31
32export async function assertBundlesTypeScriptWorker() {
33 const entry = './test/fixtures/worker.ts';

Callers

nothing calls this directly

Calls 2

executeMethod · 0.95
disposeMethod · 0.95

Tested by

no test coverage detected