@@ -2,14 +2,14 @@ import {TestBed} from '@angular/core/testing';
22import { HttpClientModule } from '@angular/common/http' ;
33import { UserService } from './user.service' ;
44import { User } from './user' ;
5- import * as Pact from 'pact-web' ;
5+ import { PactWeb , Matchers } from '@pact-foundation/ pact-web' ;
66
77describe ( 'UserService' , ( ) => {
88
99 let provider ;
1010
1111 beforeAll ( function ( done ) {
12- provider = Pact ( {
12+ provider = new PactWeb ( {
1313 consumer : 'ui' ,
1414 provider : 'userservice' ,
1515 port : 1234 ,
@@ -70,7 +70,7 @@ describe('UserService', () => {
7070 } ,
7171 willRespondWith : {
7272 status : 201 ,
73- body : Pact . Matchers . somethingLike ( {
73+ body : Matchers . somethingLike ( {
7474 id : createdUserId
7575 } ) ,
7676 headers : {
@@ -106,14 +106,14 @@ describe('UserService', () => {
106106 withRequest : {
107107 method : 'PUT' ,
108108 path : '/user-service/users/42' ,
109- body : Pact . Matchers . somethingLike ( expectedUser ) ,
109+ body : Matchers . somethingLike ( expectedUser ) ,
110110 headers : {
111111 'Content-Type' : 'application/json'
112112 }
113113 } ,
114114 willRespondWith : {
115115 status : 200 ,
116- body : Pact . Matchers . somethingLike ( expectedUser )
116+ body : Matchers . somethingLike ( expectedUser )
117117 }
118118 } ) . then ( done , error => done . fail ( error ) ) ;
119119 } ) ;
0 commit comments