Skip to content

Commit ca28699

Browse files
committed
fix: adding a test for dynamic installation strings
1 parent f443f39 commit ca28699

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/targets/index.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@ describe('addTargetClient', () => {
303303
link: 'https://example.com',
304304
description: 'A custom HTTP library',
305305
extname: '.custom',
306+
installation: request => {
307+
return `brew install ${request.fullUrl}`;
308+
},
306309
},
307310
convert: () => {
308311
return 'This was generated from a custom client.';
@@ -314,8 +317,10 @@ describe('addTargetClient', () => {
314317
const snippet = new HTTPSnippet(short.log.entries[0].request as Request, {});
315318

316319
const result = snippet.convert('node', 'custom')[0];
317-
318320
expect(result).toBe('This was generated from a custom client.');
321+
322+
const install = snippet.installation('node', 'custom')[0];
323+
expect(install).toBe('brew install https://httpbin.org/anything');
319324
});
320325
});
321326

0 commit comments

Comments
 (0)