Skip to content

Commit 1e7ac70

Browse files
tomfrenkencloud-sdk-js
andauthored
chore: Fix flaky pipeline (#5607)
* remove all remaining afterAll mocks * change to before each * Changes from lint:fix --------- Co-authored-by: cloud-sdk-js <[email protected]>
1 parent 9272ff2 commit 1e7ac70

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/generator/src/generator.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,15 @@ describe('generator', () => {
159159

160160
describe('v2', () => {
161161
let files: SourceFile[];
162-
beforeAll(async () => {
162+
beforeEach(async () => {
163163
mock({
164164
'v2-test': {},
165165
[pathTestResources]: mock.load(pathTestResources)
166166
});
167167
files = await getGeneratedFiles('v2', 'v2-test');
168168
});
169169

170-
afterAll(async () => {
170+
afterEach(async () => {
171171
mock.restore();
172172
});
173173

@@ -198,15 +198,15 @@ describe('generator', () => {
198198

199199
describe('v4', () => {
200200
let files: SourceFile[];
201-
beforeAll(async () => {
201+
beforeEach(async () => {
202202
mock({
203203
'v4-test': {},
204204
[pathTestResources]: mock.load(pathTestResources)
205205
});
206206
files = await getGeneratedFiles('v4', 'v4-test');
207207
});
208208

209-
afterAll(() => {
209+
afterEach(() => {
210210
mock.restore();
211211
});
212212

@@ -481,7 +481,7 @@ describe('generator', () => {
481481
});
482482

483483
describe('logger', () => {
484-
beforeAll(() => {
484+
beforeEach(() => {
485485
mock({
486486
common: {},
487487
'/prettier/config': JSON.stringify({ printWidth: 66 }),
@@ -491,7 +491,7 @@ describe('generator', () => {
491491
});
492492
});
493493

494-
afterAll(() => mock.restore());
494+
afterEach(() => mock.restore());
495495

496496
it('should not display verbose logs by default', async () => {
497497
const consoleSpy = jest.spyOn(process.stdout, 'write');

0 commit comments

Comments
 (0)