mirror of
https://github.com/LukeHagar/prettier-plugin-openapi.git
synced 2025-12-09 20:57:46 +00:00
Update pretest script in package.json to use bun for building. Refactor sorting logic in index.ts for OpenAPI keys, enhancing clarity and performance. Clean up test files by removing unnecessary console logs and ensuring consistent formatting.
This commit is contained in:
@@ -23,7 +23,7 @@ describe('Simple Key Ordering Tests', () => {
|
||||
// @ts-expect-error We are mocking things here
|
||||
const result = printer?.print({ getNode: () => testData }, { tabWidth: 2 }, () => '');
|
||||
expect(result).toBeDefined();
|
||||
|
||||
|
||||
if (!result) {
|
||||
throw new Error('Result is undefined');
|
||||
}
|
||||
@@ -86,7 +86,7 @@ describe('Simple Key Ordering Tests', () => {
|
||||
}
|
||||
|
||||
const resultString = result.toString();
|
||||
|
||||
|
||||
// Check that operation keys appear in the correct order
|
||||
const summaryIndex = resultString.indexOf('summary');
|
||||
const operationIdIndex = resultString.indexOf('operationId');
|
||||
@@ -141,7 +141,7 @@ describe('Simple Key Ordering Tests', () => {
|
||||
}
|
||||
|
||||
const resultString = result.toString();
|
||||
|
||||
|
||||
// Check that info keys appear in the correct order
|
||||
const titleIndex = resultString.indexOf('title');
|
||||
const versionIndex = resultString.indexOf('version');
|
||||
@@ -175,13 +175,12 @@ describe('Simple Key Ordering Tests', () => {
|
||||
|
||||
// @ts-expect-error We are mocking things here
|
||||
const result = printer?.print({ getNode: () => testData }, { tabWidth: 2 }, () => '');
|
||||
console.log('result', result);
|
||||
expect(result).toBeDefined();
|
||||
|
||||
if (!result) {
|
||||
throw new Error('Result is undefined');
|
||||
}
|
||||
|
||||
|
||||
// Custom extensions should come after standard keys
|
||||
const openapiIndex = result.toString().indexOf('openapi');
|
||||
const infoIndex = result.toString().indexOf('info');
|
||||
|
||||
Reference in New Issue
Block a user