Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Issue with AngularJs Pact Consumer DSL #55

Open
naveenkundarapu opened this issue May 2, 2016 · 3 comments
Open

Issue with AngularJs Pact Consumer DSL #55

naveenkundarapu opened this issue May 2, 2016 · 3 comments

Comments

@naveenkundarapu
Copy link

naveenkundarapu commented May 2, 2016

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
Copy link

uglyog commented May 2, 2016

@naveenkundarapu
Copy link
Author

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

@uglyog
Copy link

uglyog commented May 2, 2016

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

There is a working example, compare it with yours.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants