-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to disable sepia for certain tests #14
Comments
After analyzing sepia, it seems there's no such feature. Would you guys be interested in adding it? |
I've made a workaround: // tests/util/sepia.js
'use strict';
const http = require('http');
const https = require('https');
const originalRequests = { http: http.request, https: https.request };
const sepia = require('sepia');
const sepiaRequests = { http: http.request, https: https.request };
/**
* Turns sepia on.
*/
function enable() {
http.request = sepiaRequests.http;
https.request = sepiaRequests.https;
}
/**
* Turns sepia off.
*/
function disable() {
http.request = originalRequests.http;
https.request = originalRequests.https;
}
disable();
sepia.enable = enable;
sepia.disable = disable;
module.exports = sepia; |
Thanks, I needed this as it seems to break supertest requests to my app. I'm not sure if anyone else experienced that and has a better workaround? |
I had the same issue. This would be a great addition. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm developing a complex set of test suites and I want to disable sepia for some of them.
Besides the filter feature, is there any way to accomplish this, e.g.:
sepia.disable()/enable()
?Thanks
The text was updated successfully, but these errors were encountered: