Skip to content

Commit 7b08de7

Browse files
committed
Fix random failing test
1 parent 6f648a4 commit 7b08de7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/app/core/google-tag-manager/google-tag-manager.service.spec.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('GoogleTagManagerService', () => {
4747
}
4848
))
4949

50-
it('should be able to add script element and throw error because cannot connect with GTM', inject(
50+
it('should be able to add script element and throw error because cannot connect with GTM', inject(
5151
[GoogleTagManagerService],
5252
(service: GoogleTagManagerService) => {
5353
service.addGtmToDom().subscribe(
@@ -59,9 +59,11 @@ describe('GoogleTagManagerService', () => {
5959
)
6060
},
6161
(error) => {
62-
expect(error).toEqual({
63-
name: 'GTM - Error'
62+
expect(error).toEqual(jasmine.objectContaining({
63+
name: 'GTM - Error',
64+
message: jasmine.any(String),
6465
})
66+
)
6567
}
6668
)
6769
}
@@ -76,9 +78,11 @@ describe('GoogleTagManagerService', () => {
7678
expect(browserGlobals.windowRef().dataLayer[2]).toBeFalsy()
7779
},
7880
(error) => {
79-
expect(error).toEqual({
81+
expect(error).toEqual(jasmine.objectContaining({
8082
name: 'GTM - Error',
83+
message: jasmine.any(String),
8184
})
85+
)
8286
}
8387
)
8488
}

0 commit comments

Comments
 (0)