jest-image-snapshot 5.1.0 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [5.1.1](https://github.com/americanexpress/jest-image-snapshot/compare/v5.1.0...v5.1.1) (2022-08-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **diff-snapshot:** make recievedDir optional ([#306](https://github.com/americanexpress/jest-image-snapshot/issues/306)) ([cd4fa73](https://github.com/americanexpress/jest-image-snapshot/commit/cd4fa734dd72f8e590e8b672c3081468a5842a20)), closes [#300](https://github.com/americanexpress/jest-image-snapshot/issues/300)
7
+
1
8
  # [5.1.0](https://github.com/americanexpress/jest-image-snapshot/compare/v5.0.0...v5.1.0) (2022-05-30)
2
9
 
3
10
 
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <h1 align="center">
2
- <img src='https://github.com/americanexpress/jest-image-snapshot/raw/main/jest-image-snapshot.png' alt="Jest Image Snapshot - One Amex" width='50%'/>
2
+ <img src='https://github.com/americanexpress/jest-image-snapshot/raw/main/images/jest-image-snapshot.png' alt="Jest Image Snapshot - One Amex" width='50%'/>
3
3
  </h1>
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/jest-image-snapshot)](https://www.npmjs.com/package/jest-image-snapshot)
@@ -53,15 +53,15 @@ it('renders correctly', async () => {
53
53
  ...
54
54
  ```
55
55
 
56
- <img title="Adding an image snapshot" src="./images/create-snapshot.gif" width="50%">
56
+ <img title="Adding an image snapshot" src="https://raw.githubusercontent.com/americanexpress/jest-image-snapshot/main/images/create-snapshot.gif" width="50%">
57
57
 
58
58
  Then after a few days as I finish adding another feature to my component I notice one of my tests failing!
59
59
 
60
- <img title="A failing image snapshot test" src="./images/fail-snapshot.gif" width="50%">
60
+ <img title="A failing image snapshot test" src="https://raw.githubusercontent.com/americanexpress/jest-image-snapshot/main/images/fail-snapshot.gif" width="50%">
61
61
 
62
62
  Oh no! I must have introduced a regression! Let's see what the diff looks like to identify what I need to fix:
63
63
 
64
- <img title="Image diff" src="./images/image-diff.png" width="50%">
64
+ <img title="Image diff" src="https://raw.githubusercontent.com/americanexpress/jest-image-snapshot/main/images/image-diff.png" width="50%">
65
65
 
66
66
  And now that I know that I broke the card art I can fix it!
67
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jest-image-snapshot",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "Jest matcher for image comparisons. Most commonly used for visual regression testing.",
5
5
  "main": "src/index.js",
6
6
  "engines": {
@@ -190,8 +190,8 @@ function diffImageToSnapshot(options) {
190
190
  snapshotIdentifier,
191
191
  snapshotsDir,
192
192
  storeReceivedOnFailure,
193
- receivedDir,
194
- diffDir,
193
+ receivedDir = path.join(options.snapshotsDir, '__received_output__'),
194
+ diffDir = path.join(options.snapshotsDir, '__diff_output__'),
195
195
  diffDirection,
196
196
  updateSnapshot = false,
197
197
  updatePassedSnapshot = false,
package/src/index.js CHANGED
@@ -193,8 +193,8 @@ function configureToMatchImageSnapshot({
193
193
  });
194
194
 
195
195
  const snapshotsDir = customSnapshotsDir || path.join(path.dirname(testPath), SNAPSHOTS_DIR);
196
- const receivedDir = customReceivedDir || path.join(snapshotsDir, '__received_output__');
197
- const diffDir = customDiffDir || path.join(snapshotsDir, '__diff_output__');
196
+ const receivedDir = customReceivedDir;
197
+ const diffDir = customDiffDir;
198
198
  const baselineSnapshotPath = path.join(snapshotsDir, `${snapshotIdentifier}-snap.png`);
199
199
  OutdatedSnapshotReporter.markTouchedFile(baselineSnapshotPath);
200
200
 
@@ -1,2 +0,0 @@
1
- one-app-team-review-requested:
2
- - '**/*'
@@ -1,33 +0,0 @@
1
- <!--- Provide a general summary of your changes in the Title above -->
2
-
3
- ## Description
4
- <!--- Describe your changes in detail -->
5
-
6
- ## Motivation and Context
7
- <!--- Why is this change required? What problem does it solve? -->
8
- <!--- If it fixes an open issue, please link to the issue here. -->
9
-
10
- ## How Has This Been Tested?
11
- <!--- Please describe in detail how you tested your changes. -->
12
- <!--- Include details of your testing environment, tests ran to see how -->
13
- <!--- your change affects other areas of the code, etc. -->
14
-
15
- ## Types of Changes
16
- <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
17
- - [ ] Bug fix (non-breaking change which fixes an issue)
18
- - [ ] New feature (non-breaking change which adds functionality)
19
- - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
20
- - [ ] Documentation (adding or updating documentation)
21
- - [ ] Dependency update
22
-
23
- ## Checklist:
24
- <!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
25
- <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
26
- - [ ] My change requires a change to the documentation and I have updated the documentation accordingly.
27
- - [ ] My changes are in sync with the code style of this project.
28
- - [ ] There aren't any other open Pull Requests for the same issue/update.
29
- - [ ] These changes should be applied to a maintenance branch.
30
- - [ ] I have added the Apache 2.0 license header to any new files created.
31
-
32
- ## What is the Impact to Developers Using Jest-Image-Snapshot?
33
- <!--- Please describe how your changes impacts developers using Jest-Image-Snapshot. -->
@@ -1,31 +0,0 @@
1
- name: Health Check
2
-
3
- on:
4
- schedule:
5
- # At minute 0 past hour 0800 and 2000.
6
- - cron: '0 8,20 * * *'
7
-
8
- jobs:
9
- tests:
10
- runs-on: ubuntu-latest
11
- strategy:
12
- matrix:
13
- node: [ '10.x', '12.x', '14.x', '16.x' ]
14
- name: Node ${{ matrix.node }}
15
- steps:
16
- - uses: actions/checkout@v2
17
- - run: |
18
- git remote set-branches --add origin main
19
- git fetch
20
- - name: Setup Node
21
- uses: actions/setup-node@v2
22
- with:
23
- node-version: ${{ matrix.node }}
24
- - name: Install Dependencies
25
- run: npm ci
26
- env:
27
- NODE_ENV: development
28
- - name: Run Test Script
29
- run: npm run test
30
- env:
31
- NODE_ENV: production
@@ -1,12 +0,0 @@
1
- name: "Pull Request Labeler"
2
- on:
3
- pull_request_target:
4
- types: [opened, reopened]
5
-
6
- jobs:
7
- triage:
8
- runs-on: ubuntu-latest
9
- steps:
10
- - uses: actions/labeler@v3
11
- with:
12
- repo-token: "${{ secrets.GITHUB_TOKEN }}"
@@ -1,37 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- jobs:
9
- prepare:
10
- runs-on: ubuntu-latest
11
- if: "! contains(github.event.head_commit.message, '[skip ci]')"
12
- steps:
13
- - run: echo "${{ github.event.head_commit.message }}"
14
- release:
15
- needs: prepare
16
- name: Release
17
- runs-on: ubuntu-latest
18
- steps:
19
- - name: Checkout
20
- uses: actions/checkout@v2
21
- with:
22
- persist-credentials: false
23
- - name: Setup Node.js
24
- uses: actions/setup-node@v2
25
- with:
26
- node-version: 12
27
- - name: Install dependencies
28
- run: npm ci
29
- - name: Release
30
- env:
31
- GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
32
- GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
33
- GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
34
- GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
35
- GITHUB_TOKEN: ${{ secrets.PA_TOKEN }}
36
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37
- run: npx semantic-release
@@ -1,23 +0,0 @@
1
- name: Mark stale issues and pull requests
2
-
3
- on:
4
- schedule:
5
- - cron: "0 0 * * *"
6
-
7
- jobs:
8
- stale:
9
-
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - uses: actions/stale@v3
14
- with:
15
- repo-token: ${{ secrets.GITHUB_TOKEN }}
16
- stale-issue-message: 'This issue is stale because it has been open 30 days with no activity.'
17
- stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity.'
18
- stale-issue-label: 'stale-issue'
19
- exempt-issue-labels: 'enhancement,documentation,good-first-issue,question,bug'
20
- stale-pr-label: 'stale-pr'
21
- exempt-pr-labels: 'work-in-progress'
22
- days-before-stale: 30
23
- days-before-close: -1
@@ -1,43 +0,0 @@
1
- name: Tests
2
-
3
- on:
4
- pull_request:
5
- branches:
6
- - main
7
-
8
- jobs:
9
- tests:
10
- runs-on: ubuntu-latest
11
- strategy:
12
- matrix:
13
- node: [ '14.x', '16.x', '18.x' ]
14
- name: Node ${{ matrix.node }}
15
- steps:
16
- - uses: actions/checkout@v2
17
- - run: |
18
- git remote set-branches --add origin main
19
- git fetch
20
- - name: Setup Node
21
- uses: actions/setup-node@v2
22
- with:
23
- node-version: ${{ matrix.node }}
24
- - name: Install Dependencies
25
- run: npm ci
26
- env:
27
- NODE_ENV: development
28
- - name: Unit Tests
29
- run: npm run test
30
- env:
31
- NODE_ENV: production
32
- - name: Lockfile Lint Test
33
- run: npm run test:lockfile
34
- env:
35
- NODE_ENV: production
36
- - name: Git History Test
37
- run: npm run test:git-history
38
- env:
39
- NODE_ENV: production
40
- - name: Lint
41
- run: npm run lint
42
- env:
43
- NODE_ENV: production
Binary file
Binary file
Binary file
Binary file