File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
apps/example-app-karma/src Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { render , screen } from '@testing-library/angular' ;
2
+
3
+ it ( 'can use jasmine matchers' , async ( ) => {
4
+ await render ( `<div>Hello {{ name}}</div>` , {
5
+ componentProperties : {
6
+ name : 'Sarah' ,
7
+ } ,
8
+ } ) ;
9
+
10
+ expect ( screen . getByText ( 'Hello Sarah' ) ) . toBeVisible ( ) ;
11
+ } ) ;
Original file line number Diff line number Diff line change 2
2
import 'zone.js/dist/zone-testing' ;
3
3
import { getTestBed } from '@angular/core/testing' ;
4
4
import { BrowserDynamicTestingModule , platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing' ;
5
+ import JasmineDOM from '@testing-library/jasmine-dom/dist' ;
6
+
7
+ beforeAll ( ( ) => {
8
+ jasmine . getEnv ( ) . addMatchers ( JasmineDOM ) ;
9
+ } ) ;
5
10
6
11
declare const require : any ;
7
12
You can’t perform that action at this time.
0 commit comments