Open naveenkundarapu opened 8 years ago
Have you had a look at https://github.com/DiUS/pact-consumer-js-dsl/wiki/Using-Pact-with-Angular ?
Hi, thanks for your reply. Yes am using ngMidwayTester...
Have a look through this post: https://groups.google.com/forum/#!topic/pact-support/Wmde7jEnJOQ
There is a working example, compare it with yours.
Hi Am trying to generate pacts consumer contracts. Am trying invoke an angular service which makes a simple xmlhttprequest. and before each, I have below code angular.module('modulename', [ 'component', 'ngMockE2E' ]);
tester = ngMidwayTester('modulename'); customService = tester.inject('serviceToBeInjected');
$httpBackend = tester.inject('$httpBackend');
$httpBackend.whenGET('/search').passThrough();
But when I run karma test task to generate pact it simply exits after "putInteractions" method. But contracts file is not generated. when I hit the service from browser or postman I get {"message":"No interaction found for GET /search","interaction_diffs":[]} I tried putting console loggers inside pact-consumer-js-dsl.js. it simply exits after putInteractions method. no errors found!
am using Karma,Jasmine, AngularJs, pact_node(for pact server). Could you please help me out...