import { Definition, HelloDefinition } from '@devvit/protos';
import { ActorSpec, LinkedBundle } from '@devvit/protos/types/devvit/runtime/bundle.js';
import CircuitBreakApp from './CircuitBreakApp.js';
import FetchApp from './FetchApp.js';
import PingApp from './PingApp.js';
export const circuitBreakAppBundle = newTestLinkedBundle('test.local', `module.exports = {default: ${CircuitBreakApp}}`);
export const fetchAppBundle = newTestLinkedBundle('test.local', `module.exports = {default: ${FetchApp}}`);
export const pingAppBundle = newTestLinkedBundle('test.local', `console.log('eval'); module.exports = {default: ${PingApp}}`);
export function newTestLinkedBundle(hostname, code, uses = []) {
    return LinkedBundle.fromPartial({
        hostname,
        code,
        actor: ActorSpec.fromPartial({ name: hostname, owner: 'snoo', version: '1.2.3' }),
        provides: [Definition.toSerializable(HelloDefinition)],
        uses,
    });
}
