Skip to content

Commit e89b916

Browse files
authored
chore(deps): bump (#1304)
## 🧰 Changes - [x] the bump of `@oclif/core` messed with some of the bespoke logic in our `prerun` hook. i was initially looking into it with the intent of filing a bug in that repo, but i'm pretty sure what we were doing there was going against the grain of how oclif works, so i ended up refactoring it, which ended up cleaning up the logic and tests a bunch in the process? you can see that work in 109b6c9 - [x] removes `@readme/eslint-config` once and for all (and copies/inlines our prettier config) - [x] small refactor to better pass around the `this` context so we can reduce our reliance on our bespoke debugger - [x] bumps dependencies, see below: before: ``` Package Current Wanted Latest Location Depended by @oclif/core 4.4.0 4.5.1 4.5.1 node_modules/@oclif/core rdme @oclif/plugin-autocomplete 3.2.31 3.2.33 3.2.33 node_modules/@oclif/plugin-autocomplete rdme @oclif/plugin-help 6.2.29 6.2.31 6.2.31 node_modules/@oclif/plugin-help rdme @oclif/plugin-plugins 5.4.43 5.4.44 5.4.44 node_modules/@oclif/plugin-plugins rdme @oclif/plugin-warn-if-update-available 3.1.42 3.1.44 3.1.44 node_modules/@oclif/plugin-warn-if-update-available rdme ci-info 4.2.0 4.3.0 4.3.0 node_modules/ci-info rdme oclif 4.20.1 4.20.6 4.20.6 node_modules/oclif rdme rollup 4.44.1 4.45.0 4.45.0 node_modules/rollup rdme undici 5.29.0 5.29.0 7.11.0 node_modules/undici rdme ``` after: ``` Package Current Wanted Latest Location Depended by undici 5.29.0 5.29.0 7.11.0 node_modules/undici rdme ```
1 parent 96c907c commit e89b916

File tree

11 files changed

+2175
-6829
lines changed

11 files changed

+2175
-6829
lines changed

__tests__/commands/openapi/__snapshots__/validate.test.ts.snap

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`rdme openapi validate > CI tests > should fail if user attempts to pass \`--github\` flag in CI environment 1`] = `
4-
[Error: Parsing --github
4+
{
5+
"error": [Error: Parsing --github
56
The \`--github\` flag is only for usage in non-CI environments.
6-
See more help with --help]
7+
See more help with --help],
8+
"stderr": "",
9+
"stdout": "",
10+
}
711
`;
812
913
exports[`rdme openapi validate > CI tests > should successfully validate prompt and not run GHA onboarding 1`] = `

__tests__/commands/openapi/validate.test.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vite
55

66
import Command from '../../../src/commands/openapi/validate.js';
77
import { gitMock } from '../../helpers/git-mock.js';
8-
import { type OclifOutput, runCommand, runCommandWithHooks } from '../../helpers/oclif.js';
8+
import { type OclifOutput, runCommand } from '../../helpers/oclif.js';
99

1010
describe('rdme openapi validate', () => {
1111
let run: (args?: string[]) => OclifOutput;
@@ -96,15 +96,9 @@ describe('rdme openapi validate', () => {
9696
});
9797

9898
it('should fail if user attempts to pass `--github` flag in CI environment', async () => {
99-
return expect(
100-
(
101-
await runCommandWithHooks([
102-
'openapi validate',
103-
'__tests__/__fixtures__/petstore-simple-weird-version.json',
104-
'--github',
105-
])
106-
).error,
107-
).toMatchSnapshot();
99+
const spec = '__tests__/__fixtures__/petstore-simple-weird-version.json';
100+
101+
await expect(run([spec, '--github'])).resolves.toMatchSnapshot();
108102
});
109103
});
110104

__tests__/helpers/oclif.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { CommandClass } from '../../src/index.js';
33
import path from 'node:path';
44

55
import { Config } from '@oclif/core';
6-
import { captureOutput, runCommand as oclifRunCommand } from '@oclif/test';
6+
import { captureOutput } from '@oclif/test';
77

88
export type OclifOutput<T = string> = ReturnType<typeof captureOutput<T>>;
99

@@ -63,13 +63,3 @@ export function runCommandAndReturnResult(Command: CommandClass) {
6363
return result;
6464
};
6565
}
66-
67-
/**
68-
* This runs the command you pass in against the args you pass in.
69-
* This helper is not ideal in that `vitest --watch` won't reload,
70-
* but it's helpful if you need to run assertions against the command's hooks.
71-
*/
72-
export async function runCommandWithHooks(args?: string[]) {
73-
const oclifConfig = await setupOclifConfig();
74-
return oclifRunCommand(args, oclifConfig, { testNodeEnv });
75-
}

0 commit comments

Comments
 (0)