Skip to content

Commit d39b758

Browse files
committed
feat: debug accepts an element to be pretty printed
1 parent 53409eb commit d39b758

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Lightweight utility functions to test Angular components.
2626
- [How](#how)
2727
- [`createComponent`](#createcomponent)
2828
- [`container: HTMLElement`](#container-htmlelement)
29-
- [`debug() => void`](#debug--void)
29+
- [`debug(element: HTMLElement) => void`](#debug--void)
3030
- [`fixture: any`](#fixture-any)
3131
- [Usage](#usage)
3232
- [LICENSE](#license)
@@ -111,7 +111,7 @@ The DOM node containing the Angular component.
111111

112112
All of the [dom-testing-library][dom-testing-library] query functions are binded to this container.
113113

114-
#### `debug() => void`
114+
#### `debug(element: HTMLElement) => void`
115115

116116
Prints out the container.
117117

projects/testing-library/src/lib/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getQueriesForElement, FireObject } from 'dom-testing-library';
44

55
export interface RenderResult extends ReturnType<typeof getQueriesForElement>, FireObject {
66
container: HTMLElement;
7-
debug: () => void;
7+
debug: (element: HTMLElement) => void;
88
fixture: ComponentFixture<any>;
99
}
1010

projects/testing-library/src/lib/testing-library.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export async function createComponent<T>(
5454
return {
5555
fixture,
5656
container: fixture.nativeElement,
57-
debug: () => console.log(prettyDOM(fixture.nativeElement)),
57+
debug: (element = fixture.nativeElement) => console.log(prettyDOM(element)),
5858
...eventsWithDetectChanges,
5959
...getQueriesForElement(fixture.nativeElement),
6060
};

0 commit comments

Comments
 (0)