Skip to content

Commit 6d82ad5

Browse files
committed
chore: more test tweaks
1 parent f134acb commit 6d82ad5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

__tests__/commands/docs/upload.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { describe, afterEach, it, expect, beforeAll, beforeEach, vi } from 'vite
66

77
import Command from '../../../src/commands/docs/upload.js';
88
import { getAPIv1Mock, getAPIv2Mock, getAPIv2MockForGHA } from '../../helpers/get-api-mock.js';
9+
import { githubActionsEnv } from '../../helpers/git-mock.js';
910
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
10-
import { after, before } from '../../helpers/setup-gha-env.js';
1111

1212
const key = 'rdme_123';
1313
const authorization = `Bearer ${key}`;
@@ -277,9 +277,9 @@ describe('rdme docs upload', () => {
277277
});
278278

279279
describe('and the command is being run in a CI environment', () => {
280-
beforeEach(before);
280+
beforeEach(githubActionsEnv.before);
281281

282-
afterEach(after);
282+
afterEach(githubActionsEnv.after);
283283

284284
it('should create a guides page in ReadMe and include `x-readme-source-url` source header', async () => {
285285
const headMock = getAPIv2MockForGHA({ authorization }).head('/versions/stable/guides/new-doc').reply(404);

__tests__/commands/openapi/upload.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it } from 'vitest';
66
import Command from '../../../src/commands/openapi/upload.js';
77
import petstore from '../../__fixtures__/petstore-simple-weird-version.json' with { type: 'json' };
88
import { getAPIv2Mock, getAPIv2MockForGHA } from '../../helpers/get-api-mock.js';
9+
import { githubActionsEnv } from '../../helpers/git-mock.js';
910
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
10-
import { after, before } from '../../helpers/setup-gha-env.js';
1111

1212
const key = 'rdme_123';
1313
const version = '1.0.0';
@@ -299,9 +299,9 @@ describe('rdme openapi upload', () => {
299299
});
300300

301301
describe('and the command is being run in a CI environment', () => {
302-
beforeEach(before);
302+
beforeEach(githubActionsEnv.before);
303303

304-
afterEach(after);
304+
afterEach(githubActionsEnv.after);
305305

306306
it('should overwrite an existing API definition without asking for confirmation', async () => {
307307
const mock = getAPIv2MockForGHA({ authorization: `Bearer ${key}` })

0 commit comments

Comments
 (0)