faux-jax icon indicating copy to clipboard operation
faux-jax copied to clipboard

faux-jax 5.0.6 breaking change?

Open yanndinendal opened this issue 8 years ago • 1 comments

I get some breaking tests since faux-jax 5.0.6 (they don't happen with 5.0.1 to 5.0.5).

"after all" hook: Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.

Maybe because the update of the mitm dependency? There is something like this in taht test:

function setupFauxJax() {
  fauxJax.install();
  // https://github.com/moll/node-mitm#bypassing-interception
  fauxJax._mitm.on('connect', function trapSomeRequests(socket, opts) {
    if (['some.host', 'other.host']
      .indexOf(opts.host) !== -1) {
      // intercept
      return null;
    }

    socket.bypass();
  });
}

called here in the tests:

  beforeEach(() => {
    setupFauxJax();
  });

  afterEach(() => {
    fauxJax.restore();
  });

yanndinendal avatar Feb 09 '17 15:02 yanndinendal

The only thing I can tell you is that in between we upgraded to the latest mitm. If you can dig this that's be great. Thanks!

vvo avatar Feb 10 '17 07:02 vvo