jest-prettyhtml-matchers 1.17.13 → 1.17.15

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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # jest-prettyhtml-matchers
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/jest-prettyhtml-matchers.svg?style=flat-square)](https://www.npmjs.com/package/jest-prettyhtml-matchers)
4
- [![build status](https://img.shields.io/github/workflow/status/tanem/jest-prettyhtml-matchers/CI?style=flat-square)](https://github.com/tanem/jest-prettyhtml-matchers/actions?query=workflow%3ACI)
4
+ [![build status](https://img.shields.io/github/actions/workflow/status/tanem/jest-prettyhtml-matchers/ci.yml?style=flat-square)](https://github.com/tanem/jest-prettyhtml-matchers/actions?query=workflow%3ACI)
5
5
  [![coverage status](https://img.shields.io/codecov/c/github/tanem/jest-prettyhtml-matchers.svg?style=flat-square)](https://codecov.io/gh/tanem/jest-prettyhtml-matchers)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/jest-prettyhtml-matchers.svg?style=flat-square)](https://www.npmjs.com/package/jest-prettyhtml-matchers)
7
7
 
@@ -4,11 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createFormatter = void 0;
7
- var prettyhtml_1 = __importDefault(require("@starptech/prettyhtml"));
8
- var createFormatter = function (options) {
9
- return function (input) {
10
- return (0, prettyhtml_1.default)(input, options).contents;
11
- };
12
- };
7
+ const prettyhtml_1 = __importDefault(require("@starptech/prettyhtml"));
8
+ const createFormatter = (options) => (input) => (0, prettyhtml_1.default)(input, options).contents;
13
9
  exports.createFormatter = createFormatter;
14
10
  //# sourceMappingURL=create-formatter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-formatter.js","sourceRoot":"","sources":["../src/create-formatter.ts"],"names":[],"mappings":";;;;;;AAAA,qEAA8C;AAGvC,IAAM,eAAe,GAC1B,UAAC,OAA0B;IAC3B,OAAA,UAAC,KAAK;QACJ,OAAA,IAAA,oBAAU,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ;IAAnC,CAAmC;AADrC,CACqC,CAAA;AAH1B,QAAA,eAAe,mBAGW"}
1
+ {"version":3,"file":"create-formatter.js","sourceRoot":"","sources":["../src/create-formatter.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA8C;AAGvC,MAAM,eAAe,GAC1B,CAAC,OAA0B,EAAU,EAAE,CACvC,CAAC,KAAK,EAAE,EAAE,CACR,IAAA,oBAAU,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAA;AAH1B,QAAA,eAAe,mBAGW"}
@@ -10,6 +10,6 @@ declare global {
10
10
  }
11
11
  }
12
12
  export declare const createPrettyHtmlMatchers: (options?: PrettyHtmlOptions) => {
13
- toMatchPrettyHtmlSnapshot: (this: any, received: string, options?: string | PrettyHtmlOptions | undefined, hint?: string | undefined) => import("expect").ExpectationResult;
14
- toMatchInlinePrettyHtmlSnapshot: (this: any, received: string, options?: string | PrettyHtmlOptions | undefined, inlineSnapshot?: string | undefined) => import("expect").ExpectationResult;
13
+ toMatchPrettyHtmlSnapshot: (this: any, received: string, options?: PrettyHtmlOptions | string, hint?: string) => import("expect").ExpectationResult;
14
+ toMatchInlinePrettyHtmlSnapshot: (this: any, received: string, options?: PrettyHtmlOptions | string, inlineSnapshot?: string) => import("expect").ExpectationResult;
15
15
  };
@@ -1,17 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createPrettyHtmlMatchers = void 0;
4
- var create_formatter_1 = require("./create-formatter");
5
- var create_to_match_inline_prettyhtml_snapshot_1 = require("./create-to-match-inline-prettyhtml-snapshot");
6
- var create_to_match_prettyhtml_snapshot_1 = require("./create-to-match-prettyhtml-snapshot");
7
- var createPrettyHtmlMatchers = function (options) {
8
- if (options === void 0) { options = {}; }
9
- var format = (0, create_formatter_1.createFormatter)(options);
10
- var toMatchPrettyHtmlSnapshot = (0, create_to_match_prettyhtml_snapshot_1.createToMatchPrettyHtmlSnapshot)(format);
11
- var toMatchInlinePrettyHtmlSnapshot = (0, create_to_match_inline_prettyhtml_snapshot_1.createToMatchInlinePrettyHtmlSnapshot)(format);
4
+ const create_formatter_1 = require("./create-formatter");
5
+ const create_to_match_inline_prettyhtml_snapshot_1 = require("./create-to-match-inline-prettyhtml-snapshot");
6
+ const create_to_match_prettyhtml_snapshot_1 = require("./create-to-match-prettyhtml-snapshot");
7
+ const createPrettyHtmlMatchers = (options = {}) => {
8
+ const format = (0, create_formatter_1.createFormatter)(options);
9
+ const toMatchPrettyHtmlSnapshot = (0, create_to_match_prettyhtml_snapshot_1.createToMatchPrettyHtmlSnapshot)(format);
10
+ const toMatchInlinePrettyHtmlSnapshot = (0, create_to_match_inline_prettyhtml_snapshot_1.createToMatchInlinePrettyHtmlSnapshot)(format);
12
11
  return {
13
- toMatchPrettyHtmlSnapshot: toMatchPrettyHtmlSnapshot,
14
- toMatchInlinePrettyHtmlSnapshot: toMatchInlinePrettyHtmlSnapshot,
12
+ toMatchPrettyHtmlSnapshot,
13
+ toMatchInlinePrettyHtmlSnapshot,
15
14
  };
16
15
  };
17
16
  exports.createPrettyHtmlMatchers = createPrettyHtmlMatchers;
@@ -1 +1 @@
1
- {"version":3,"file":"create-prettyhtml-matchers.js","sourceRoot":"","sources":["../src/create-prettyhtml-matchers.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AACpD,2GAAoG;AACpG,6FAAuF;AAiBhF,IAAM,wBAAwB,GAAG,UAAC,OAA+B;IAA/B,wBAAA,EAAA,YAA+B;IACtE,IAAM,MAAM,GAAG,IAAA,kCAAe,EAAC,OAAO,CAAC,CAAA;IACvC,IAAM,yBAAyB,GAAG,IAAA,qEAA+B,EAAC,MAAM,CAAC,CAAA;IACzE,IAAM,+BAA+B,GACnC,IAAA,kFAAqC,EAAC,MAAM,CAAC,CAAA;IAC/C,OAAO;QACL,yBAAyB,2BAAA;QACzB,+BAA+B,iCAAA;KAChC,CAAA;AACH,CAAC,CAAA;AATY,QAAA,wBAAwB,4BASpC"}
1
+ {"version":3,"file":"create-prettyhtml-matchers.js","sourceRoot":"","sources":["../src/create-prettyhtml-matchers.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AACpD,6GAAoG;AACpG,+FAAuF;AAiBhF,MAAM,wBAAwB,GAAG,CAAC,UAA6B,EAAE,EAAE,EAAE;IAC1E,MAAM,MAAM,GAAG,IAAA,kCAAe,EAAC,OAAO,CAAC,CAAA;IACvC,MAAM,yBAAyB,GAAG,IAAA,qEAA+B,EAAC,MAAM,CAAC,CAAA;IACzE,MAAM,+BAA+B,GACnC,IAAA,kFAAqC,EAAC,MAAM,CAAC,CAAA;IAC/C,OAAO;QACL,yBAAyB;QACzB,+BAA+B;KAChC,CAAA;AACH,CAAC,CAAA;AATY,QAAA,wBAAwB,4BASpC"}
@@ -1,39 +1,26 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.createToMatchInlinePrettyHtmlSnapshot = void 0;
15
- var jest_snapshot_1 = require("jest-snapshot");
16
- var create_formatter_1 = require("./create-formatter");
17
- var createToMatchInlinePrettyHtmlSnapshot = function (format) {
18
- return function toMatchInlinePrettyHtmlSnapshot(received, options, inlineSnapshot) {
19
- if (typeof options === 'object') {
20
- format = (0, create_formatter_1.createFormatter)(options);
21
- }
22
- else {
23
- inlineSnapshot = options;
24
- }
25
- var error = new Error();
26
- var newStack = error.stack
27
- .split(/\n/)
28
- .filter(function (_, index) { return index !== 1; })
29
- .join('\n');
30
- error.stack = newStack;
31
- var newContext = __assign(__assign({}, this), { error: error });
32
- if (inlineSnapshot) {
33
- return jest_snapshot_1.toMatchInlineSnapshot.call(newContext, format(received), inlineSnapshot);
34
- }
35
- return jest_snapshot_1.toMatchInlineSnapshot.call(newContext, format(received));
36
- };
4
+ const jest_snapshot_1 = require("jest-snapshot");
5
+ const create_formatter_1 = require("./create-formatter");
6
+ const createToMatchInlinePrettyHtmlSnapshot = (format) => function toMatchInlinePrettyHtmlSnapshot(received, options, inlineSnapshot) {
7
+ if (typeof options === 'object') {
8
+ format = (0, create_formatter_1.createFormatter)(options);
9
+ }
10
+ else {
11
+ inlineSnapshot = options;
12
+ }
13
+ const error = new Error();
14
+ const newStack = error.stack
15
+ .split(/\n/)
16
+ .filter((_, index) => index !== 1)
17
+ .join('\n');
18
+ error.stack = newStack;
19
+ const newContext = Object.assign(Object.assign({}, this), { error });
20
+ if (inlineSnapshot) {
21
+ return jest_snapshot_1.toMatchInlineSnapshot.call(newContext, format(received), inlineSnapshot);
22
+ }
23
+ return jest_snapshot_1.toMatchInlineSnapshot.call(newContext, format(received));
37
24
  };
38
25
  exports.createToMatchInlinePrettyHtmlSnapshot = createToMatchInlinePrettyHtmlSnapshot;
39
26
  //# sourceMappingURL=create-to-match-inline-prettyhtml-snapshot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-to-match-inline-prettyhtml-snapshot.js","sourceRoot":"","sources":["../src/create-to-match-inline-prettyhtml-snapshot.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+CAAqD;AACrD,uDAAoD;AAG7C,IAAM,qCAAqC,GAAG,UAAC,MAAc;IAClE,OAAA,SAAS,+BAA+B,CAEtC,QAAgB,EAChB,OAAoC,EACpC,cAAuB;QAEvB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,MAAM,GAAG,IAAA,kCAAe,EAAC,OAAO,CAAC,CAAA;QACnC,CAAC;aAAM,CAAC;YACN,cAAc,GAAG,OAAO,CAAA;QAC1B,CAAC;QAED,IAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;QACzB,IAAM,QAAQ,GAAI,KAAK,CAAC,KAAgB;aACrC,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,UAAC,CAAC,EAAE,KAAK,IAAK,OAAA,KAAK,KAAK,CAAC,EAAX,CAAW,CAAC;aACjC,IAAI,CAAC,IAAI,CAAC,CAAA;QACb,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAA;QAEtB,IAAM,UAAU,yBAAQ,IAAI,KAAE,KAAK,OAAA,GAAE,CAAA;QAErC,IAAI,cAAc,EAAE,CAAC;YACnB,OAAO,qCAAqB,CAAC,IAAI,CAC/B,UAAU,EACV,MAAM,CAAC,QAAQ,CAAC,EAGhB,cAAc,CACf,CAAA;QACH,CAAC;QAED,OAAO,qCAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;IACjE,CAAC;AAhCD,CAgCC,CAAA;AAjCU,QAAA,qCAAqC,yCAiC/C"}
1
+ {"version":3,"file":"create-to-match-inline-prettyhtml-snapshot.js","sourceRoot":"","sources":["../src/create-to-match-inline-prettyhtml-snapshot.ts"],"names":[],"mappings":";;;AAAA,iDAAqD;AACrD,yDAAoD;AAG7C,MAAM,qCAAqC,GAAG,CAAC,MAAc,EAAE,EAAE,CACtE,SAAS,+BAA+B,CAEtC,QAAgB,EAChB,OAAoC,EACpC,cAAuB;IAEvB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,GAAG,IAAA,kCAAe,EAAC,OAAO,CAAC,CAAA;IACnC,CAAC;SAAM,CAAC;QACN,cAAc,GAAG,OAAO,CAAA;IAC1B,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;IACzB,MAAM,QAAQ,GAAI,KAAK,CAAC,KAAgB;SACrC,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC;SACjC,IAAI,CAAC,IAAI,CAAC,CAAA;IACb,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAA;IAEtB,MAAM,UAAU,mCAAQ,IAAI,KAAE,KAAK,GAAE,CAAA;IAErC,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,qCAAqB,CAAC,IAAI,CAC/B,UAAU,EACV,MAAM,CAAC,QAAQ,CAAC,EAGhB,cAAc,CACf,CAAA;IACH,CAAC;IAED,OAAO,qCAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;AACjE,CAAC,CAAA;AAjCU,QAAA,qCAAqC,yCAiC/C"}
@@ -1,21 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createToMatchPrettyHtmlSnapshot = void 0;
4
- var jest_snapshot_1 = require("jest-snapshot");
5
- var create_formatter_1 = require("./create-formatter");
6
- var createToMatchPrettyHtmlSnapshot = function (format) {
7
- return function toMatchPrettyHtmlSnapshot(received, options, hint) {
8
- if (typeof options === 'object') {
9
- format = (0, create_formatter_1.createFormatter)(options);
10
- }
11
- else {
12
- hint = options;
13
- }
14
- if (hint) {
15
- return jest_snapshot_1.toMatchSnapshot.call(this, format(received), hint);
16
- }
17
- return jest_snapshot_1.toMatchSnapshot.call(this, format(received));
18
- };
4
+ const jest_snapshot_1 = require("jest-snapshot");
5
+ const create_formatter_1 = require("./create-formatter");
6
+ const createToMatchPrettyHtmlSnapshot = (format) => function toMatchPrettyHtmlSnapshot(received, options, hint) {
7
+ if (typeof options === 'object') {
8
+ format = (0, create_formatter_1.createFormatter)(options);
9
+ }
10
+ else {
11
+ hint = options;
12
+ }
13
+ if (hint) {
14
+ return jest_snapshot_1.toMatchSnapshot.call(this, format(received), hint);
15
+ }
16
+ return jest_snapshot_1.toMatchSnapshot.call(this, format(received));
19
17
  };
20
18
  exports.createToMatchPrettyHtmlSnapshot = createToMatchPrettyHtmlSnapshot;
21
19
  //# sourceMappingURL=create-to-match-prettyhtml-snapshot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-to-match-prettyhtml-snapshot.js","sourceRoot":"","sources":["../src/create-to-match-prettyhtml-snapshot.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,uDAAoD;AAG7C,IAAM,+BAA+B,GAAG,UAAC,MAAc;IAC5D,OAAA,SAAS,yBAAyB,CAEhC,QAAgB,EAChB,OAAoC,EACpC,IAAa;QAEb,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,MAAM,GAAG,IAAA,kCAAe,EAAC,OAAO,CAAC,CAAA;QACnC,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,OAAO,CAAA;QAChB,CAAC;QAED,IAAI,IAAI,EAAE,CAAC;YAGT,OAAO,+BAAe,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAA;QAC3D,CAAC;QAED,OAAO,+BAAe,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;IACrD,CAAC;AAnBD,CAmBC,CAAA;AApBU,QAAA,+BAA+B,mCAoBzC"}
1
+ {"version":3,"file":"create-to-match-prettyhtml-snapshot.js","sourceRoot":"","sources":["../src/create-to-match-prettyhtml-snapshot.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAC/C,yDAAoD;AAG7C,MAAM,+BAA+B,GAAG,CAAC,MAAc,EAAE,EAAE,CAChE,SAAS,yBAAyB,CAEhC,QAAgB,EAChB,OAAoC,EACpC,IAAa;IAEb,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,GAAG,IAAA,kCAAe,EAAC,OAAO,CAAC,CAAA;IACnC,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,OAAO,CAAA;IAChB,CAAC;IAED,IAAI,IAAI,EAAE,CAAC;QAGT,OAAO,+BAAe,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAA;IAC3D,CAAC;IAED,OAAO,+BAAe,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;AACrD,CAAC,CAAA;AApBU,QAAA,+BAA+B,mCAoBzC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jest-prettyhtml-matchers",
3
- "version": "1.17.13",
3
+ "version": "1.17.15",
4
4
  "description": "Custom Jest snapshot matchers that use prettyhtml to format strings.",
5
5
  "author": "Tane Morgan (https://github.com/tanem)",
6
6
  "main": "dist/index.js",
@@ -24,15 +24,15 @@
24
24
  "license": "MIT",
25
25
  "scripts": {
26
26
  "check": "run-s check:*",
27
- "check:format": "prettier --list-different \"**/*.{js,ts}\"",
27
+ "check:format": "prettier --list-different \"**/*.{mjs,js,ts}\"",
28
28
  "check:types": "tsc --noEmit",
29
29
  "clean": "run-s clean:*",
30
30
  "clean:coverage": "del coverage",
31
31
  "clean:dist": "del dist ",
32
32
  "clean:test": "ts-node scripts/clean",
33
33
  "compile": "tsc -p tsconfig.base.json",
34
- "format": "prettier --write \"**/*.{js,ts}\"",
35
- "lint": "eslint . --ext .js,.ts",
34
+ "format": "prettier --write \"**/*.{mjs,js,ts}\"",
35
+ "lint": "eslint .",
36
36
  "release": "tanem-scripts release",
37
37
  "test": "run-s check lint clean compile && ts-node scripts/test"
38
38
  },
@@ -44,23 +44,24 @@
44
44
  "@starptech/prettyhtml": "^0.10.0"
45
45
  },
46
46
  "devDependencies": {
47
+ "@eslint/eslintrc": "3.2.0",
48
+ "@eslint/js": "9.15.0",
47
49
  "@types/fs-extra": "11.0.4",
48
- "@types/glob": "8.1.0",
49
- "@types/jest": "29.5.11",
50
- "@typescript-eslint/eslint-plugin": "6.20.0",
51
- "@typescript-eslint/parser": "6.20.0",
50
+ "@types/jest": "29.5.14",
51
+ "@typescript-eslint/eslint-plugin": "8.15.0",
52
+ "@typescript-eslint/parser": "8.15.0",
52
53
  "del": "6.1.1",
53
- "del-cli": "5.1.0",
54
- "eslint": "8.56.0",
54
+ "del-cli": "6.0.0",
55
+ "eslint": "9.15.0",
55
56
  "eslint-config-prettier": "9.1.0",
56
57
  "fs-extra": "11.2.0",
57
58
  "jest": "29.7.0",
58
59
  "jest-snapshot": "29.7.0",
59
- "npm-run-all2": "6.1.1",
60
- "prettier": "3.2.4",
61
- "tanem-scripts": "7.0.25",
62
- "ts-jest": "29.1.2",
60
+ "npm-run-all2": "7.0.1",
61
+ "prettier": "3.3.3",
62
+ "tanem-scripts": "7.0.27",
63
+ "ts-jest": "29.2.5",
63
64
  "ts-node": "10.9.2",
64
- "typescript": "5.3.3"
65
+ "typescript": "5.7.2"
65
66
  }
66
67
  }