DiUS / pact-consumer-js-dsl

*DEPRECATED* A Javascript DSL for creating pacts, superceded by Pact JS
https://github.com/pact-foundation/pact-js
Other
56 stars 26 forks source link

Issue with AngularJs Pact Consumer DSL #55

Open naveenkundarapu opened 8 years ago

naveenkundarapu commented 8 years ago

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...

uglyog commented 8 years ago

Have you had a look at https://github.com/DiUS/pact-consumer-js-dsl/wiki/Using-Pact-with-Angular ?

naveenkundarapu commented 8 years ago

Hi, thanks for your reply. Yes am using ngMidwayTester...

uglyog commented 8 years ago

Have a look through this post: https://groups.google.com/forum/#!topic/pact-support/Wmde7jEnJOQ

There is a working example, compare it with yours.