jest-prettyhtml-matchers 1.10.7 → 1.11.0
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/dist/create-formatter.js +7 -1
- package/dist/create-formatter.js.map +1 -1
- package/dist/create-prettyhtml-matchers.d.ts +9 -33
- package/dist/create-prettyhtml-matchers.js +6 -4
- package/dist/create-prettyhtml-matchers.js.map +1 -1
- package/dist/create-to-match-inline-prettyhtml-snapshot.d.ts +4 -16
- package/dist/create-to-match-inline-prettyhtml-snapshot.js +4 -2
- package/dist/create-to-match-inline-prettyhtml-snapshot.js.map +1 -1
- package/dist/create-to-match-prettyhtml-snapshot.d.ts +4 -16
- package/dist/create-to-match-prettyhtml-snapshot.js +4 -2
- package/dist/create-to-match-prettyhtml-snapshot.js.map +1 -1
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/create-formatter.js
CHANGED
|
@@ -3,6 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createFormatter = void 0;
|
|
6
7
|
var prettyhtml_1 = __importDefault(require("@starptech/prettyhtml"));
|
|
7
|
-
|
|
8
|
+
var createFormatter = function (options) {
|
|
9
|
+
return function (input) {
|
|
10
|
+
return (0, prettyhtml_1.default)(input, options).contents;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
exports.createFormatter = createFormatter;
|
|
8
14
|
//# sourceMappingURL=create-formatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-formatter.js","sourceRoot":"","sources":["../src/create-formatter.ts"],"names":[],"mappings":"
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import type { PrettyHtmlOptions } from './types';
|
|
2
2
|
declare global {
|
|
3
3
|
namespace jest {
|
|
4
|
-
interface Matchers<R
|
|
4
|
+
interface Matchers<R> {
|
|
5
5
|
toMatchInlinePrettyHtmlSnapshot(inlineSnapshot?: string): R;
|
|
6
6
|
toMatchInlinePrettyHtmlSnapshot(options?: PrettyHtmlOptions, inlineSnapshot?: string): R;
|
|
7
7
|
toMatchPrettyHtmlSnapshot(hint?: string): R;
|
|
@@ -11,41 +11,17 @@ declare global {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const createPrettyHtmlMatchers: (options?: PrettyHtmlOptions) => {
|
|
13
13
|
toMatchPrettyHtmlSnapshot: (this: any, received: string, options?: string | PrettyHtmlOptions | undefined, hint?: string | undefined) => {
|
|
14
|
-
message: () => string;
|
|
15
|
-
name: string;
|
|
16
14
|
pass: boolean;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} | {
|
|
20
|
-
message: () => string;
|
|
15
|
+
message(): string;
|
|
16
|
+
} | Promise<{
|
|
21
17
|
pass: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
expected?: undefined;
|
|
25
|
-
} | {
|
|
26
|
-
actual: string;
|
|
27
|
-
expected: string | undefined;
|
|
28
|
-
message: () => string;
|
|
29
|
-
name: string;
|
|
30
|
-
pass: boolean;
|
|
31
|
-
};
|
|
18
|
+
message(): string;
|
|
19
|
+
}>;
|
|
32
20
|
toMatchInlinePrettyHtmlSnapshot: (this: any, received: string, options?: string | PrettyHtmlOptions | undefined, inlineSnapshot?: string | undefined) => {
|
|
33
|
-
message: () => string;
|
|
34
|
-
name: string;
|
|
35
|
-
pass: boolean;
|
|
36
|
-
actual?: undefined;
|
|
37
|
-
expected?: undefined;
|
|
38
|
-
} | {
|
|
39
|
-
message: () => string;
|
|
40
21
|
pass: boolean;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
expected?: undefined;
|
|
44
|
-
} | {
|
|
45
|
-
actual: string;
|
|
46
|
-
expected: string | undefined;
|
|
47
|
-
message: () => string;
|
|
48
|
-
name: string;
|
|
22
|
+
message(): string;
|
|
23
|
+
} | Promise<{
|
|
49
24
|
pass: boolean;
|
|
50
|
-
|
|
25
|
+
message(): string;
|
|
26
|
+
}>;
|
|
51
27
|
};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPrettyHtmlMatchers = void 0;
|
|
3
4
|
var create_formatter_1 = require("./create-formatter");
|
|
4
5
|
var create_to_match_inline_prettyhtml_snapshot_1 = require("./create-to-match-inline-prettyhtml-snapshot");
|
|
5
6
|
var create_to_match_prettyhtml_snapshot_1 = require("./create-to-match-prettyhtml-snapshot");
|
|
6
|
-
|
|
7
|
+
var createPrettyHtmlMatchers = function (options) {
|
|
7
8
|
if (options === void 0) { options = {}; }
|
|
8
|
-
var format = create_formatter_1.createFormatter(options);
|
|
9
|
-
var toMatchPrettyHtmlSnapshot = create_to_match_prettyhtml_snapshot_1.createToMatchPrettyHtmlSnapshot(format);
|
|
10
|
-
var toMatchInlinePrettyHtmlSnapshot = create_to_match_inline_prettyhtml_snapshot_1.createToMatchInlinePrettyHtmlSnapshot(format);
|
|
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);
|
|
11
12
|
return {
|
|
12
13
|
toMatchPrettyHtmlSnapshot: toMatchPrettyHtmlSnapshot,
|
|
13
14
|
toMatchInlinePrettyHtmlSnapshot: toMatchInlinePrettyHtmlSnapshot,
|
|
14
15
|
};
|
|
15
16
|
};
|
|
17
|
+
exports.createPrettyHtmlMatchers = createPrettyHtmlMatchers;
|
|
16
18
|
//# sourceMappingURL=create-prettyhtml-matchers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-prettyhtml-matchers.js","sourceRoot":"","sources":["../src/create-prettyhtml-matchers.ts"],"names":[],"mappings":"
|
|
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,20 +1,8 @@
|
|
|
1
1
|
import type { Format, PrettyHtmlOptions } from './types';
|
|
2
2
|
export declare const createToMatchInlinePrettyHtmlSnapshot: (format: Format) => (this: any, received: string, options?: string | PrettyHtmlOptions | undefined, inlineSnapshot?: string | undefined) => {
|
|
3
|
-
message: () => string;
|
|
4
|
-
name: string;
|
|
5
3
|
pass: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} | {
|
|
9
|
-
message: () => string;
|
|
4
|
+
message(): string;
|
|
5
|
+
} | Promise<{
|
|
10
6
|
pass: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
expected?: undefined;
|
|
14
|
-
} | {
|
|
15
|
-
actual: string;
|
|
16
|
-
expected: string | undefined;
|
|
17
|
-
message: () => string;
|
|
18
|
-
name: string;
|
|
19
|
-
pass: boolean;
|
|
20
|
-
};
|
|
7
|
+
message(): string;
|
|
8
|
+
}>;
|
|
@@ -11,12 +11,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.createToMatchInlinePrettyHtmlSnapshot = void 0;
|
|
14
15
|
var jest_snapshot_1 = require("jest-snapshot");
|
|
15
16
|
var create_formatter_1 = require("./create-formatter");
|
|
16
|
-
|
|
17
|
+
var createToMatchInlinePrettyHtmlSnapshot = function (format) {
|
|
17
18
|
return function toMatchInlinePrettyHtmlSnapshot(received, options, inlineSnapshot) {
|
|
18
19
|
if (typeof options === 'object') {
|
|
19
|
-
format = create_formatter_1.createFormatter(options);
|
|
20
|
+
format = (0, create_formatter_1.createFormatter)(options);
|
|
20
21
|
}
|
|
21
22
|
else {
|
|
22
23
|
inlineSnapshot = options;
|
|
@@ -34,4 +35,5 @@ exports.createToMatchInlinePrettyHtmlSnapshot = function (format) {
|
|
|
34
35
|
return jest_snapshot_1.toMatchInlineSnapshot.call(newContext, format(received));
|
|
35
36
|
};
|
|
36
37
|
};
|
|
38
|
+
exports.createToMatchInlinePrettyHtmlSnapshot = createToMatchInlinePrettyHtmlSnapshot;
|
|
37
39
|
//# 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":"
|
|
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;YAC/B,MAAM,GAAG,IAAA,kCAAe,EAAC,OAAO,CAAC,CAAA;SAClC;aAAM;YACL,cAAc,GAAG,OAAO,CAAA;SACzB;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;YAClB,OAAO,qCAAqB,CAAC,IAAI,CAC/B,UAAU,EACV,MAAM,CAAC,QAAQ,CAAC,EAGhB,cAAc,CACf,CAAA;SACF;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,20 +1,8 @@
|
|
|
1
1
|
import type { Format, PrettyHtmlOptions } from './types';
|
|
2
2
|
export declare const createToMatchPrettyHtmlSnapshot: (format: Format) => (this: any, received: string, options?: string | PrettyHtmlOptions | undefined, hint?: string | undefined) => {
|
|
3
|
-
message: () => string;
|
|
4
|
-
name: string;
|
|
5
3
|
pass: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} | {
|
|
9
|
-
message: () => string;
|
|
4
|
+
message(): string;
|
|
5
|
+
} | Promise<{
|
|
10
6
|
pass: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
expected?: undefined;
|
|
14
|
-
} | {
|
|
15
|
-
actual: string;
|
|
16
|
-
expected: string | undefined;
|
|
17
|
-
message: () => string;
|
|
18
|
-
name: string;
|
|
19
|
-
pass: boolean;
|
|
20
|
-
};
|
|
7
|
+
message(): string;
|
|
8
|
+
}>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createToMatchPrettyHtmlSnapshot = void 0;
|
|
3
4
|
var jest_snapshot_1 = require("jest-snapshot");
|
|
4
5
|
var create_formatter_1 = require("./create-formatter");
|
|
5
|
-
|
|
6
|
+
var createToMatchPrettyHtmlSnapshot = function (format) {
|
|
6
7
|
return function toMatchPrettyHtmlSnapshot(received, options, hint) {
|
|
7
8
|
if (typeof options === 'object') {
|
|
8
|
-
format = create_formatter_1.createFormatter(options);
|
|
9
|
+
format = (0, create_formatter_1.createFormatter)(options);
|
|
9
10
|
}
|
|
10
11
|
else {
|
|
11
12
|
hint = options;
|
|
@@ -16,4 +17,5 @@ exports.createToMatchPrettyHtmlSnapshot = function (format) {
|
|
|
16
17
|
return jest_snapshot_1.toMatchSnapshot.call(this, format(received));
|
|
17
18
|
};
|
|
18
19
|
};
|
|
20
|
+
exports.createToMatchPrettyHtmlSnapshot = createToMatchPrettyHtmlSnapshot;
|
|
19
21
|
//# 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":"
|
|
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;YAC/B,MAAM,GAAG,IAAA,kCAAe,EAAC,OAAO,CAAC,CAAA;SAClC;aAAM;YACL,IAAI,GAAG,OAAO,CAAA;SACf;QAED,IAAI,IAAI,EAAE;YAGR,OAAO,+BAAe,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAA;SAC1D;QAED,OAAO,+BAAe,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;IACrD,CAAC;AAnBD,CAmBC,CAAA;AApBU,QAAA,+BAA+B,mCAoBzC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
17
|
+
__exportStar(require("./create-prettyhtml-matchers"), exports);
|
|
7
18
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA4C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-prettyhtml-matchers",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
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",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"test": "ts-node scripts/test"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"jest": "^25.0.0 || ^26.0.0 || ^27.0.0",
|
|
42
|
-
"jest-snapshot": "^25.0.0 || ^26.0.0 || ^27.0.0"
|
|
41
|
+
"jest": "^25.0.0 || ^26.0.0 || ^27.0.0 || ^28.0.0",
|
|
42
|
+
"jest-snapshot": "^25.0.0 || ^26.0.0 || ^27.0.0 || ^28.0.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@starptech/prettyhtml": "^0.10.0"
|
|
@@ -47,21 +47,21 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/fs-extra": "9.0.13",
|
|
49
49
|
"@types/glob": "7.2.0",
|
|
50
|
-
"@types/jest": "27.
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
52
|
-
"@typescript-eslint/parser": "5.
|
|
50
|
+
"@types/jest": "27.5.0",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "5.23.0",
|
|
52
|
+
"@typescript-eslint/parser": "5.23.0",
|
|
53
53
|
"del": "6.0.0",
|
|
54
54
|
"del-cli": "4.0.1",
|
|
55
|
-
"eslint": "8.
|
|
55
|
+
"eslint": "8.15.0",
|
|
56
56
|
"eslint-config-prettier": "8.5.0",
|
|
57
57
|
"fs-extra": "10.1.0",
|
|
58
|
-
"jest": "
|
|
59
|
-
"jest-snapshot": "
|
|
58
|
+
"jest": "28.1.0",
|
|
59
|
+
"jest-snapshot": "28.1.0",
|
|
60
60
|
"npm-run-all": "4.1.5",
|
|
61
61
|
"prettier": "2.6.2",
|
|
62
|
-
"tanem-scripts": "6.0.
|
|
63
|
-
"ts-jest": "
|
|
62
|
+
"tanem-scripts": "6.0.47",
|
|
63
|
+
"ts-jest": "28.0.2",
|
|
64
64
|
"ts-node": "10.7.0",
|
|
65
|
-
"typescript": "4.6.
|
|
65
|
+
"typescript": "4.6.4"
|
|
66
66
|
}
|
|
67
67
|
}
|