style: apply prettier formatting to scripts and tests
parent
a864f2e28d
commit
2fb5168b2b
File diff suppressed because it is too large
Load Diff
|
|
@ -337,10 +337,7 @@ describe('RapiDoc Mini component', () => {
|
|||
* Tests that API section pages show only tags (immediate children)
|
||||
*/
|
||||
describe('API section page structure', () => {
|
||||
const sectionPages = [
|
||||
'/influxdb3/core/api/',
|
||||
'/influxdb3/enterprise/api/',
|
||||
];
|
||||
const sectionPages = ['/influxdb3/core/api/', '/influxdb3/enterprise/api/'];
|
||||
|
||||
sectionPages.forEach((page) => {
|
||||
describe(`Section page ${page}`, () => {
|
||||
|
|
@ -417,15 +414,24 @@ describe('All endpoints page', () => {
|
|||
});
|
||||
|
||||
it('operation cards have method badges', () => {
|
||||
cy.get('.api-operation-card .api-method').should('have.length.at.least', 10);
|
||||
cy.get('.api-operation-card .api-method').should(
|
||||
'have.length.at.least',
|
||||
10
|
||||
);
|
||||
});
|
||||
|
||||
it('operation cards have path codes', () => {
|
||||
cy.get('.api-operation-card .api-path').should('have.length.at.least', 10);
|
||||
cy.get('.api-operation-card .api-path').should(
|
||||
'have.length.at.least',
|
||||
10
|
||||
);
|
||||
});
|
||||
|
||||
it('operation cards link to operation pages', () => {
|
||||
cy.get('.api-operation-card').first().should('have.attr', 'href').and('match', /\/api\//);
|
||||
cy.get('.api-operation-card')
|
||||
.first()
|
||||
.should('have.attr', 'href')
|
||||
.and('match', /\/api\//);
|
||||
});
|
||||
|
||||
it('is accessible from navigation', () => {
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ function test(name, fn) {
|
|||
|
||||
function assertEquals(actual, expected, message) {
|
||||
if (actual !== expected) {
|
||||
throw new Error(
|
||||
message || `Expected ${expected}, got ${actual}`
|
||||
);
|
||||
throw new Error(message || `Expected ${expected}, got ${actual}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@ function test(name, fn) {
|
|||
|
||||
function assertEquals(actual, expected, message) {
|
||||
if (actual !== expected) {
|
||||
throw new Error(
|
||||
message || `Expected ${expected}, got ${actual}`
|
||||
);
|
||||
throw new Error(message || `Expected ${expected}, got ${actual}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1217,7 +1217,7 @@ async function executePhase(options) {
|
|||
|
||||
try {
|
||||
const editorCommand = resolveEditor(options.editor);
|
||||
const filePaths = result.created.map(file => join(REPO_ROOT, file));
|
||||
const filePaths = result.created.map((file) => join(REPO_ROOT, file));
|
||||
const wait = shouldWait(options.wait);
|
||||
|
||||
spawnEditor(editorCommand, filePaths, wait);
|
||||
|
|
@ -1225,13 +1225,19 @@ async function executePhase(options) {
|
|||
if (wait) {
|
||||
log('✓ Editor closed', 'green');
|
||||
} else {
|
||||
log(' Editor will open in background (CLI exits immediately)', 'cyan');
|
||||
log(
|
||||
' Editor will open in background (CLI exits immediately)',
|
||||
'cyan'
|
||||
);
|
||||
log(' Use --wait flag to block until editor closes', 'cyan');
|
||||
log('✓ Editor launched', 'green');
|
||||
}
|
||||
} catch (error) {
|
||||
log(`\n✗ Failed to open editor: ${error.message}`, 'red');
|
||||
log('\nFiles were created successfully but could not be opened.', 'yellow');
|
||||
log(
|
||||
'\nFiles were created successfully but could not be opened.',
|
||||
'yellow'
|
||||
);
|
||||
log('You can open them manually:', 'yellow');
|
||||
result.created.forEach((file) => {
|
||||
log(` ${file}`, 'yellow');
|
||||
|
|
|
|||
|
|
@ -15,9 +15,8 @@ import { platform } from 'os';
|
|||
*/
|
||||
function commandExists(command) {
|
||||
try {
|
||||
const cmd = platform() === 'win32'
|
||||
? `where ${command}`
|
||||
: `command -v ${command}`;
|
||||
const cmd =
|
||||
platform() === 'win32' ? `where ${command}` : `command -v ${command}`;
|
||||
execSync(cmd, { stdio: 'ignore' });
|
||||
return true;
|
||||
} catch {
|
||||
|
|
@ -59,10 +58,10 @@ export function resolveEditor(options = {}) {
|
|||
|
||||
throw new Error(
|
||||
'No suitable editor found. Set EDITOR environment variable or use --editor flag.\n' +
|
||||
'Examples:\n' +
|
||||
' export EDITOR=vim\n' +
|
||||
' export EDITOR=nano\n' +
|
||||
' docs edit <url> --editor vim'
|
||||
'Examples:\n' +
|
||||
' export EDITOR=vim\n' +
|
||||
' export EDITOR=nano\n' +
|
||||
' docs edit <url> --editor vim'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue