Skip to content

Commit c608f26

Browse files
HolgerJerominHolger Jeromin
andauthored
🤖 Merge PR DefinitelyTyped#74181 [jasmine] add jasmine.pp API by @HolgerJeromin
Co-authored-by: Holger Jeromin <Holger Jeromin mailgithub@katur.de>
1 parent 4d7098d commit c608f26

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

types/jasmine/index.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,16 @@ declare namespace jasmine {
371371
*/
372372
function DiffBuilder(): DiffBuilder;
373373

374+
/**
375+
* Formats a value for display, taking into account the current set of
376+
* custom object formatters.
377+
*
378+
* @since 6.0.0
379+
* @param value The value to pretty-print
380+
* @returns The pretty-printed value
381+
*/
382+
function pp(value: any): string;
383+
374384
/**
375385
* That will succeed if the actual value being compared is an instance of the specified class/constructor.
376386
*/

types/jasmine/jasmine-tests.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2604,6 +2604,15 @@ describe("Debug logging", function() {
26042604
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
26052605
jasmine.MAX_PRETTY_PRINT_DEPTH = 40;
26062606

2607+
jasmine.pp(true);
2608+
jasmine.pp("string");
2609+
jasmine.pp(42);
2610+
jasmine.pp({ key: "value" });
2611+
jasmine.pp([1, 2, 3]);
2612+
jasmine.pp(new Map());
2613+
jasmine.pp(new Set());
2614+
jasmine.pp(() => {});
2615+
26072616
(async () => {
26082617
throwUnless(1).toEqual(2);
26092618

types/jasmine/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/jasmine",
4-
"version": "5.1.9999",
4+
"version": "6.0.9999",
55
"projects": [
66
"http://jasmine.github.io"
77
],

0 commit comments

Comments
 (0)