Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion book/advanced/ch14-portability-testing.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ WebSocket 하네스에는 "백프레셔(backpressure)" 테스트도 포함되어
13장에서 커스텀 어댑터를 구현했다면, 이제 하네스를 사용해 이를 검증해야 합니다. 이는 어댑터가 fluo 동작 계약을 준수하는지 확인하는 핵심 테스트입니다. 이식성 하네스를 통과하면 기존 비즈니스 로직을 깨뜨리지 않고 서로 다른 런타임에 어댑터를 배포할 수 있다는 근거를 얻습니다.

```typescript
import { FluoFactory } from '@fluojs/runtime';
import { createHttpAdapterPortabilityHarness } from '@fluojs/testing/http-adapter-portability';
import { myAdapter } from './my-adapter';

Expand All @@ -215,7 +216,9 @@ const harness = createHttpAdapterPortabilityHarness({
return app;
},
run: async (module, opts) => {
return await FluoFactory.run(module, { adapter: myAdapter(opts) });
const app = await FluoFactory.create(module, { adapter: myAdapter(opts) });
await app.listen();
return app;
}
});

Expand Down
5 changes: 4 additions & 1 deletion book/advanced/ch14-portability-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ The WebSocket harness also includes "backpressure" tests. These verify that the
If you implemented a custom adapter in Chapter 13, you should now verify it with the harness. This is the key test that checks whether your adapter complies with the fluo Behavioral Contract. Passing the portability harness gives you evidence that the adapter can be deployed to different runtimes without breaking existing business logic.

```typescript
import { FluoFactory } from '@fluojs/runtime';
import { createHttpAdapterPortabilityHarness } from '@fluojs/testing/http-adapter-portability';
import { myAdapter } from './my-adapter';

Expand All @@ -215,7 +216,9 @@ const harness = createHttpAdapterPortabilityHarness({
return app;
},
run: async (module, opts) => {
return await FluoFactory.run(module, { adapter: myAdapter(opts) });
const app = await FluoFactory.create(module, { adapter: myAdapter(opts) });
await app.listen();
return app;
}
});

Expand Down