Skip to content

Commit

Permalink
feat!: remove API v1 openapi command
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Dec 6, 2024
1 parent 652d0ee commit 1b62a06
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 2,012 deletions.
1,440 changes: 0 additions & 1,440 deletions __tests__/commands/openapi/index.test.ts

This file was deleted.

63 changes: 0 additions & 63 deletions __tests__/lib/prompts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,70 +15,7 @@ const versionlist = [
},
];

const specList = [
{
_id: 'spec1',
title: 'spec1_title',
},
{
_id: 'spec2',
title: 'spec2_title',
},
];

const getSpecs = () => {
return {
body: [
{
_id: 'spec3',
title: 'spec3_title',
},
],
} as unknown as Promise<Response>;
};

describe('prompt test bed', () => {
describe('createOasPrompt()', () => {
it('should return a create option if selected', async () => {
prompts.inject(['create']);

const answer = await promptTerminal(
promptHandler.createOasPrompt(
[
{
_id: '1234',
title: 'buster',
},
],
{},
1,
null,
),
);

expect(answer).toStrictEqual({ option: 'create' });
});

it('should return specId if user chooses to update file', async () => {
prompts.inject(['update', 'spec1']);

const parsedDocs = {
next: {
page: 2,
url: '',
},
prev: {
page: 1,
url: '',
},
};

const answer = await promptTerminal(promptHandler.createOasPrompt(specList, parsedDocs, 1, getSpecs));

expect(answer).toStrictEqual({ option: 'spec1' });
});
});

describe('versionPrompt()', () => {
it('should allow user to choose a fork if flag is not passed (creating version)', async () => {
prompts.inject(['1', true, true]);
Expand Down
19 changes: 0 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"simple-git": "^3.19.1",
"string-argv": "^0.3.2",
"table": "^6.8.1",
"tmp-promise": "^3.0.2",
"toposort": "^2.0.2",
"undici": "^5.28.4",
"validator": "^13.7.0"
Expand Down
Loading

0 comments on commit 1b62a06

Please sign in to comment.