assaf / node-replay

When API testing slows you down: record and replay HTTP responses like a boss
http://documentup.com/assaf/node-replay
MIT License
522 stars 107 forks source link

require('supertest') has to come before require('replay') #147

Open ggb667 opened 6 years ago

ggb667 commented 6 years ago

Supertest has to come before replay's require because integration points for http are different. I think this could be fixed to make it agnostic.

//const Replay  = require('replay');
//Replay.mode = 'replay';
//Replay.fixtures = __dirname + '/fixtures/replay';var server = require("../../server/server");
var server = require("../../server/server");
var msContentPersonalization = require('supertest')(server);//('http://localhost:3101');
const Replay  = require('replay');
Replay.mode = 'replay';
Replay.fixtures = __dirname + '/fixtures/replay';

If you swap commenting for the bottom and top 3 lines node-replay won't function.