Skip to content

Commit 5c3fc14

Browse files
committed
jest: no need to clear mock for integration tests
Signed-off-by: CrazyMax <[email protected]>
1 parent 7b876a9 commit 5c3fc14

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

__tests__/buildx/bake.test.itg.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
17+
import {describe, expect, test} from '@jest/globals';
1818
import * as fs from 'fs';
1919
import * as path from 'path';
2020

@@ -25,10 +25,6 @@ const fixturesDir = path.join(__dirname, '..', 'fixtures');
2525

2626
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
2727

28-
beforeEach(() => {
29-
jest.clearAllMocks();
30-
});
31-
3228
maybe('getDefinition', () => {
3329
// prettier-ignore
3430
test.each([

__tests__/buildx/history.test.itg.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
17+
import {describe, expect, test} from '@jest/globals';
1818
import * as fs from 'fs';
1919
import * as path from 'path';
2020

@@ -31,10 +31,6 @@ const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-history-jest');
3131

3232
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
3333

34-
beforeEach(() => {
35-
jest.clearAllMocks();
36-
});
37-
3834
maybe('exportBuild', () => {
3935
// prettier-ignore
4036
test.each([

__tests__/github.test.itg.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import {beforeEach, describe, expect, it, jest, test} from '@jest/globals';
17+
import {describe, expect, it, test} from '@jest/globals';
1818
import fs from 'fs';
1919
import * as path from 'path';
2020

@@ -32,10 +32,6 @@ const tmpDir = path.join(process.env.TEMP || '/tmp', 'github-jest');
3232

3333
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
3434

35-
beforeEach(() => {
36-
jest.clearAllMocks();
37-
});
38-
3935
maybe('uploadArtifact', () => {
4036
it('uploads an artifact', async () => {
4137
const res = await GitHub.uploadArtifact({

jest.config.itg.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ process.env = Object.assign({}, process.env, {
3333
};
3434

3535
module.exports = {
36-
clearMocks: true,
3736
testEnvironment: 'node',
3837
moduleFileExtensions: ['js', 'ts'],
3938
setupFiles: ['dotenv/config'],

0 commit comments

Comments
 (0)