Skip to content

Commit

Permalink
rai test: simplify mock (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
wydengyre authored Feb 24, 2024
1 parent 99f5c77 commit 6370a49
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/rai/feed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const baseUrl = new URL("https://test.dev/");
const raiBaseUrl = new URL("https://rai.dev/");
const poolSize = 5; // arbitrary

const feedFetchFn: FetchWithErr = () =>
Promise.resolve(json(feedJson) as OkResponse);
const mediaFetchFn: FetchWithErr = (input) =>
Promise.resolve({
url: input
Expand All @@ -36,7 +34,7 @@ const mediaFetchFn: FetchWithErr = (input) =>
async function convertFeedSuccess() {
const fetchWithErr: FetchWithErr = async (input) => {
return input.toString().endsWith("foo.json")
? feedFetchFn(input)
? Promise.resolve(json(feedJson) as OkResponse)
: mediaFetchFn(input);
};
const conf: RssConvertConf = { raiBaseUrl, baseUrl, poolSize, fetchWithErr };
Expand Down

0 comments on commit 6370a49

Please sign in to comment.