Skip to content

Commit

Permalink
chore: no need to clear mock for integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Jun 17, 2024
1 parent ac74d3d commit 7699014
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
6 changes: 1 addition & 5 deletions __tests__/buildx/bake.test.itg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import {beforeEach, describe, expect, jest, test} from '@jest/globals';
import {describe, expect, test} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';

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

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

beforeEach(() => {
jest.clearAllMocks();
});

maybe('getDefinition', () => {
// prettier-ignore
test.each([
Expand Down
6 changes: 1 addition & 5 deletions __tests__/buildx/history.test.itg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import {beforeEach, describe, expect, jest, test} from '@jest/globals';
import {describe, expect, test} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';

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

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

beforeEach(() => {
jest.clearAllMocks();
});

maybe('exportBuild', () => {
// prettier-ignore
test.each([
Expand Down
6 changes: 1 addition & 5 deletions __tests__/github.test.itg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import {beforeEach, describe, expect, it, jest, test} from '@jest/globals';
import {describe, expect, it, test} from '@jest/globals';
import fs from 'fs';
import * as path from 'path';

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

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

beforeEach(() => {
jest.clearAllMocks();
});

maybe('uploadArtifact', () => {
it('uploads an artifact', async () => {
const res = await GitHub.uploadArtifact({
Expand Down
4 changes: 0 additions & 4 deletions jest.config.itg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-actions-toolkit-'))

process.env = Object.assign({}, process.env, {
TEMP: tmpDir,
GITHUB_REPOSITORY: 'docker/actions-toolkit',
GITHUB_RUN_ATTEMPT: 2,
GITHUB_RUN_ID: 2188748038,
GITHUB_RUN_NUMBER: 15,
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
}) as {
Expand Down

0 comments on commit 7699014

Please sign in to comment.