title: Pact exited with code 1
body: <p>I'm trying to execute some tests with <code>Pact</code> library and I'm getting some errors. Here is the test configuration:</p>
  
  <pre><code>const path = require('path');
  const Pact = require('pact');
  const expect = require('expect.js');
  const config = require('../../../src/server/config');
  const service = require('../../../src/routes/interactions/interactions.service');
  
  describe('@component/interactions tests', () =&gt; {
      const url = 'http://localhost';
      const port = 8989;
  
      const provider = Pact({
          port: port,
          log: path.resolve(process.cwd(), 'test/component/interactions/log/interactions-pact.log'),
          dir: path.resolve(process.cwd(), 'test/component/interactions/pacts'),
          spec: 2,
          consumer: 'cx_issue',
          provider: 'interaction',
          // logLevel: 'WARN'
      });
  
      config.settingsToExport.INTERACTION_URL = `${url}:${port}`;
  
      before(done =&gt; {
          provider.setup()
              .then(() =&gt; {
                  done();
              })
              .catch(err =&gt; {
                  done(err);
              });
      });
  
      after(done =&gt; {
          provider.finalize()
              .then(() =&gt; {
                  done();
              })
              .catch(err =&gt; {
                  done(err);
              });
      });
  
      describe('#createInteraction', () =&gt; {
          before(done =&gt; {
              const INTERACTION_BODY = {
                  contact: 'contact1'
              };
              const TERM = {
                  generate: '0dae5b93-9451-4b08-b7bb-f0b944fbcdf2',
                  matcher: '^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$'
              };
  
              const pactInteractionCreate = {
                  state: 'Creates a new interaction',
                  uponReceiving: 'a new interaction is created successfully',
                  withRequest: {
                      method: 'POST',
                      path: '/interactions',
                      body: INTERACTION_BODY
                  },
                  willRespondWith: {
                      status: 201,
                      body: {
                          id: Pact.Matchers.term(TERM)
                      }
                  }
              };
  
              const promises = [
                  provider.addInteraction(pactInteractionCreate)
              ];
              Promise.all(promises)
                  .then(() =&gt; {
                      done();
                  });
          });
  
          it('/api/interactions POST', done =&gt; {
  
              const interaction = {
                  contact: 'The xx'
              };
  
              service.createInteraction(interaction)
                  .then(response =&gt; {
                      expect(response.id).to.be.equal(TERM.generate);
                      done();
                  })
                  .catch(done);
          });
      });
  });
  </code></pre>
  
  <p>This is my <code>package.json</code> file content, with all dependencies I've installed:</p>
  
  <pre><code>{
    "name": "issueAPI",
    "version": "1.0.0",
    "private": true,
    "main": "./src/index.js",
    "scripts": {
      "dev": "nodemon -e  js ./src/index.js",
      "start": "node ./src/index.js",
      "linter": "node ./node_modules/eslint/bin/eslint.js ./src",
      "test": "mocha test",
      "test-component": "mocha test/component",
      "install-test-build": "npm install &amp;&amp; npm test &amp;&amp; npm run linter",
      "test-build": "npm test &amp;&amp; npm run linter"
    },
    "jshintConfig": {
      "esversion": 6
    },
    "dependencies": {
      "ajv": "^4.11.3",
      "body-parser": "^1.17.2",
      "express": "^4.15.3",
      "express-winston": "^2.4.0",
      "request": "^2.81.0",
      "winston": "^2.3.1",
      "yamljs": "^0.2.9"
    },
    "devDependencies": {
      "@pact-foundation/pact-node": "^4.8.3",
      "dotenv": "^4.0.0",
      "eslint": "^4.2.0",
      "eslint-config-node": "^1.6.0",
      "expect.js": "^0.3.1",
      "mocha": "^3.2.0",
      "nodemon": "^1.11.0",
      "pact": "^2.3.3",
      "sinon": "^2.3.8",
      "supertest": "^3.0.0"
    }
  }
  </code></pre>
  
  <p>And this is the error I get:
  <a href="https://i.stack.imgur.com/9PRXf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9PRXf.png" alt="enter image description here"></a></p>
  
  <p>Basically, right now I don't mind at all if the tests are well or not. The main problem right now is that the pact mock server is not being started.</p>
  
  <p>The weird thing here is that I have other project where the pact tests run properly. I've moved the service I want to test from the project where is failing to the one which executes those tests fine, and it is working (at least the pact mock server is launched). The dependencies in this other project are almost the same as the problemathic project:</p>
  
  <pre><code>"dependencies": {
      "ajv": "^4.11.3",
      "body-parser": "^1.16.1",
      "dotenv": "^4.0.0",
      "express": "^4.14.0",
      "jsonwebtoken": "^7.4.1",
      "jwt-simple": "^0.5.1",
      "morgan": "^1.8.1",
      "mustache-express": "^1.2.4",
      "node-env-file": "^0.1.8",
      "request": "^2.79.0",
      "when": "^3.7.8"
    },
    "devDependencies": {
      "@pact-foundation/pact-node": "^4.8.3",
      "eslint": "^3.17.1",
      "eslint-config-node": "^1.6.0",
      "expect.js": "^0.3.1",
      "mocha": "^3.2.0",
      "nodemon": "^1.11.0",
      "pact": "^2.3.3",
      "sinon": "^1.17.7",
      "supertest": "^3.0.0",
      "nock": "^9.0.13"
    }
  </code></pre>
  
  <p>What's going on with this situation?</p>
  
  <p><strong>EDIT:</strong> I've launched the <code>pact</code> tests with <code>DEBUG</code> flag and this is the log generated:
  <a href="https://i.stack.imgur.com/18eBU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/18eBU.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/YN7Dh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YN7Dh.png" alt="enter image description here"></a></p>