Skip to content

Commit

Permalink
chore: Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed Mar 30, 2024
1 parent 514a865 commit d177c46
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
26 changes: 0 additions & 26 deletions src/crawlers/__tests__/__snapshots__/chrome-crawler.test.ts.snap

This file was deleted.

17 changes: 16 additions & 1 deletion src/crawlers/__tests__/chrome-crawler.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
import { describe, expect, it } from "bun:test";
import { crawlExtension } from "../chrome-crawler";
import { numberOfDFGCompiles } from "bun:jsc";

const githubBetterLineCountsId = "ocfdgncpifmegplaglcnglhioflaimkd";

describe("Chrome Web Store Crawler", () => {
it("should load and crawl an extension ID correctly", async () => {
const res = await crawlExtension(githubBetterLineCountsId, "en");

expect(res).toMatchSnapshot();
expect(res).toEqual({
iconUrl:
"https://lh3.googleusercontent.com/GcffNyCJaxT2G9dsQCJHhUEMlu_E0vEzph5cLPrQj7UHKat7QyCzGu69Dmp_DDUL8rY-bPMFJceQarS1wcqdwTalTg=s256",
id: githubBetterLineCountsId,
lastUpdated: expect.any(String),
longDescription: expect.stringContaining("Isn't it annoying when you"),
name: "GitHub: Better Line Counts",
rating: expect.any(Number),
reviewCount: expect.any(Number),
shortDescription: "Remove generated files from GitHub line counts",
storeUrl:
"https://chromewebstore.google.com/detail/github-better-line-counts/ocfdgncpifmegplaglcnglhioflaimkd",
version: expect.any(String),
weeklyActiveUsers: expect.any(Number),
});
});
});
2 changes: 1 addition & 1 deletion src/crawlers/chrome-crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function crawlExtension(
const { document } = parseHTML(html);

// Uncomment to debug HTML
Bun.write("chrome.html", document.documentElement.outerHTML);
// Bun.write("chrome.html", document.documentElement.outerHTML);

// Basic metadata
const name = metaContent(document, "property=og:title");
Expand Down

0 comments on commit d177c46

Please sign in to comment.