refactor: 프론트엔드 리펙토링
This commit is contained in:
@@ -3,7 +3,6 @@ import { describe, expect, it, vi } from "vitest";
|
||||
import { createContractHttpExecutor } from "../../../src/adapters/http/index.ts";
|
||||
import { createHttpObservationProjector } from "../../../src/bootstrap/runtime-adapters.ts";
|
||||
import { createReferenceFeatureInstalledInput } from "../../../src/features/reference-feature/adapters/create-reference-feature-input.ts";
|
||||
import { REFERENCE_FEATURE_TEMPLATE_CONTRIBUTION } from "../../../src/features/reference-feature/contracts/reference-feature-contract-contribution.ts";
|
||||
|
||||
function scopeSnapshot() {
|
||||
return Object.freeze({
|
||||
@@ -34,17 +33,9 @@ describe("reference feature HTTP diagnostics", () => {
|
||||
telemetry: { emit: vi.fn() },
|
||||
}),
|
||||
});
|
||||
const operations = new Map(
|
||||
REFERENCE_FEATURE_TEMPLATE_CONTRIBUTION.http.map((operation) => [
|
||||
operation.contract.operationId,
|
||||
operation,
|
||||
]),
|
||||
);
|
||||
const installed = createReferenceFeatureInstalledInput({
|
||||
contractOperations: Object.freeze({
|
||||
async execute(operationId, input, context) {
|
||||
const operation = operations.get(operationId);
|
||||
if (!operation) throw new Error("Unregistered reference operation");
|
||||
http: Object.freeze({
|
||||
async execute(operation, input, context) {
|
||||
return contractHttp.execute(operation, input, {
|
||||
routeId: context.routeId,
|
||||
scope: scopeSnapshot(),
|
||||
|
||||
Reference in New Issue
Block a user