tough-cookie.js•521 B
// Mock for tough-cookie to avoid ESM import issues in Jest
class MockCookieJar {
constructor() {
this.cookies = [];
}
async getCookies(url) {
return this.cookies;
}
async setCookie(cookie, url) {
const [nameValue] = cookie.split(';');
const [name, value] = nameValue.split('=');
this.cookies.push({ key: name, value });
}
// Add method to manually set cookies for testing
_setCookies(cookies) {
this.cookies = cookies;
}
}
module.exports = {
CookieJar: MockCookieJar,
};