Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
before(() => {
mock = superagentMock(superagent, [
{
pattern: `${URL}(.*)`,
fixtures: (match) => {
switch (match[1]) {
case 'get_movies':
return { movies: MOVIES };
default: throw new Error(404);
}
},
get: (match, data) => ({ ok: true, code: 200, body: data }),
},
]);
});