Skip to content

Commit 36962fc

Browse files
committed
refactor: update test descriptions to clarify misconfigured factory scenarios
1 parent 32602e2 commit 36962fc

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

packages/tree-shaking-plugin/src/__tests__/core/create-api-client-fn.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ api.pets.getPets.getQueryKey();
252252
`);
253253
});
254254

255-
it('rewrites generated factories that receive services as an argument when services.moduleSpecifierBase is configured', async () => {
255+
it('documents a misconfigured factory that receives services as an argument when services.moduleSpecifierBase is configured', async () => {
256256
const fixture = await fs.mkdtemp(
257257
path.join(os.tmpdir(), 'qraft-tree-shaking-')
258258
);
@@ -304,6 +304,9 @@ export function App() {
304304
}
305305
);
306306

307+
// This documents unsupported user configuration, not recommended output.
308+
// The transform treats a single createAPIClient argument as runtime options,
309+
// so external-services factories can produce semantically invalid rewrites.
307310
expect(result?.code).toMatchInlineSnapshot(`
308311
"import { services } from './api/services/index';
309312
import { qraftAPIClient } from "@openapi-qraft/react";
@@ -318,7 +321,7 @@ export function App() {
318321
`);
319322
});
320323

321-
it('rewrites generated factories that receive an operation argument when services.moduleSpecifierBase is configured', async () => {
324+
it('documents a misconfigured factory that receives an operation argument when services.moduleSpecifierBase is configured', async () => {
322325
const fixture = await fs.mkdtemp(
323326
path.join(os.tmpdir(), 'qraft-tree-shaking-')
324327
);
@@ -366,6 +369,9 @@ export function App() {
366369
}
367370
);
368371

372+
// This documents unsupported user configuration, not recommended output.
373+
// The transform treats a single createAPIClient argument as runtime options,
374+
// so external-operation factories can produce semantically invalid rewrites.
369375
expect(result?.code).toMatchInlineSnapshot(`
370376
"import { getPets } from './api/services/PetsService';
371377
import { qraftAPIClient } from "@openapi-qraft/react";

0 commit comments

Comments
 (0)