Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
goverdhan07 authored Jul 23, 2023
2 parents 71021bb + ce33742 commit 73990b7
Show file tree
Hide file tree
Showing 5 changed files with 6,887 additions and 6,834 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18
- name: Install dependencies
run: npm ci
- name: Release
Expand Down
12 changes: 5 additions & 7 deletions __tests__/diff-snapshot.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ describe('diff-snapshot', () => {
const mockFailImagePath = './__tests__/stubs/TestImageFailure.png';
const mockFailImageBuffer = fs.readFileSync(mockFailImagePath);
const mockMkdirSync = jest.fn();
const mockMkdirpSync = jest.fn();
const mockWriteFileSync = jest.fn();
const mockPixelMatch = jest.fn();
const mockGlur = jest.fn();
Expand All @@ -109,7 +108,6 @@ describe('diff-snapshot', () => {
});

jest.mock('fs', () => mockFs);
jest.mock('mkdirp', () => ({ sync: mockMkdirpSync }));
const { diffImageToSnapshot } = require('../src/diff-snapshot');

mockFs.existsSync.mockImplementation((p) => {
Expand Down Expand Up @@ -519,7 +517,7 @@ describe('diff-snapshot', () => {
failureThresholdType: 'pixel',
});

expect(mockMkdirpSync).toHaveBeenCalledWith(path.join(mockSnapshotsDir, '__diff_output__'));
expect(mockMkdirSync).toHaveBeenCalledWith(path.join(mockSnapshotsDir, '__diff_output__'), { recursive: true });
});

it('should create diff output sub-directory if there is not one already and test is failing', () => {
Expand All @@ -539,7 +537,7 @@ describe('diff-snapshot', () => {
failureThresholdType: 'pixel',
});

expect(mockMkdirpSync).toHaveBeenCalledWith(path.join(mockSnapshotsDir, '__diff_output__', 'parent'));
expect(mockMkdirSync).toHaveBeenCalledWith(path.join(mockSnapshotsDir, '__diff_output__', 'parent'), { recursive: true });
});

it('should not create diff output directory if test passed', () => {
Expand Down Expand Up @@ -588,7 +586,7 @@ describe('diff-snapshot', () => {
failureThresholdType: 'pixel',
});

expect(mockMkdirpSync).toHaveBeenCalledWith(mockSnapshotsDir);
expect(mockMkdirSync).toHaveBeenCalledWith(mockSnapshotsDir, { recursive: true });
});

it('should create snapshots sub-directory if there is not one already', () => {
Expand All @@ -605,7 +603,7 @@ describe('diff-snapshot', () => {
failureThresholdType: 'pixel',
});

expect(mockMkdirpSync).toHaveBeenCalledWith(path.join(mockSnapshotsDir, 'parent'));
expect(mockMkdirSync).toHaveBeenCalledWith(path.join(mockSnapshotsDir, 'parent'), { recursive: true });
});

it('should not create snapshots directory if there already is one', () => {
Expand Down Expand Up @@ -842,7 +840,7 @@ describe('diff-snapshot', () => {
failureThresholdType: 'pixel',
});

expect(mockMkdirpSync).toHaveBeenCalledWith(path.join(mockSnapshotsDir, '__diff_output__'));
expect(mockMkdirSync).toHaveBeenCalledWith(path.join(mockSnapshotsDir, '__diff_output__'), { recursive: true });
});
});
});
Expand Down
Loading

0 comments on commit 73990b7

Please sign in to comment.