@tryghost/jest-snapshot 0.3.11 → 0.3.14

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.
@@ -1,4 +1,4 @@
1
- const expect = require('expect');
1
+ const {jestExpect} = require('@jest/expect');
2
2
  const SnapshotManager = require('./snapshot-manager');
3
3
  const snapshotManager = new SnapshotManager();
4
4
 
@@ -25,7 +25,7 @@ const mochaHooks = {
25
25
  }
26
26
  };
27
27
 
28
- const {any, anything, stringMatching} = expect;
28
+ const {any, anything, stringMatching} = jestExpect;
29
29
 
30
30
  module.exports = {
31
31
  mochaHooks,
@@ -1,7 +1,6 @@
1
1
  const {SnapshotState, toMatchSnapshot} = require('jest-snapshot');
2
2
  const errors = require('@tryghost/errors');
3
- const expect = require('expect');
4
- const utils = require('expect/build/utils');
3
+ const utils = require('@jest/expect-utils');
5
4
  const path = require('path');
6
5
 
7
6
  class SnapshotManageer {
@@ -76,22 +75,11 @@ class SnapshotManageer {
76
75
  const {testFile, snapshotName, willUpdate} = this._getConfig();
77
76
 
78
77
  const snapshotState = this.getSnapshotState(testFile, willUpdate);
79
- // Equals is not exposed from the internals of expect
80
- // This truly bananananas workaround comes from here: https://github.com/facebook/jest/issues/11867
81
- let equals = null;
82
- expect.extend({
83
- __capture_equals__() {
84
- equals = this.equals;
85
- return {pass: true};
86
- }
87
- });
88
- expect().__capture_equals__();
89
-
90
78
  const matcher = toMatchSnapshot.bind({
91
79
  snapshotState,
92
80
  currentTestName: snapshotName,
93
81
  utils,
94
- equals
82
+ equals: utils.equals
95
83
  });
96
84
 
97
85
  // Execute the matcher
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/jest-snapshot",
3
- "version": "0.3.11",
3
+ "version": "0.3.14",
4
4
  "repository": "https://github.com/TryGhost/framework/tree/main/packages/jest-snapshot",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
@@ -19,15 +19,16 @@
19
19
  "access": "public"
20
20
  },
21
21
  "devDependencies": {
22
- "c8": "7.11.0",
23
- "mocha": "9.2.2",
22
+ "c8": "7.11.3",
23
+ "mocha": "10.0.0",
24
24
  "should": "13.2.3",
25
- "sinon": "13.0.1"
25
+ "sinon": "14.0.0"
26
26
  },
27
27
  "dependencies": {
28
- "@tryghost/errors": "^1.2.10",
29
- "expect": "^27.5.0",
30
- "jest-snapshot": "^27.5.0"
28
+ "@jest/expect": "^28.0.1",
29
+ "@jest/expect-utils": "^28.0.1",
30
+ "@tryghost/errors": "^1.2.13",
31
+ "jest-snapshot": "^28.0.0"
31
32
  },
32
- "gitHead": "4a105c2e93c720df158f10c6036f86e5575ca440"
33
+ "gitHead": "6b46efd28457ee4b86cf4ae9da9bf87238099ddd"
33
34
  }