Skip to content

Commit d177c46

Browse files
committed
chore: Fix failing test
1 parent 514a865 commit d177c46

File tree

3 files changed

+17
-28
lines changed

3 files changed

+17
-28
lines changed

src/crawlers/__tests__/__snapshots__/chrome-crawler.test.ts.snap

-26
This file was deleted.
+16-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
import { describe, expect, it } from "bun:test";
22
import { crawlExtension } from "../chrome-crawler";
3+
import { numberOfDFGCompiles } from "bun:jsc";
34

45
const githubBetterLineCountsId = "ocfdgncpifmegplaglcnglhioflaimkd";
56

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

10-
expect(res).toMatchSnapshot();
11+
expect(res).toEqual({
12+
iconUrl:
13+
"https://lh3.googleusercontent.com/GcffNyCJaxT2G9dsQCJHhUEMlu_E0vEzph5cLPrQj7UHKat7QyCzGu69Dmp_DDUL8rY-bPMFJceQarS1wcqdwTalTg=s256",
14+
id: githubBetterLineCountsId,
15+
lastUpdated: expect.any(String),
16+
longDescription: expect.stringContaining("Isn't it annoying when you"),
17+
name: "GitHub: Better Line Counts",
18+
rating: expect.any(Number),
19+
reviewCount: expect.any(Number),
20+
shortDescription: "Remove generated files from GitHub line counts",
21+
storeUrl:
22+
"https://chromewebstore.google.com/detail/github-better-line-counts/ocfdgncpifmegplaglcnglhioflaimkd",
23+
version: expect.any(String),
24+
weeklyActiveUsers: expect.any(Number),
25+
});
1126
});
1227
});

src/crawlers/chrome-crawler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function crawlExtension(
2121
const { document } = parseHTML(html);
2222

2323
// Uncomment to debug HTML
24-
Bun.write("chrome.html", document.documentElement.outerHTML);
24+
// Bun.write("chrome.html", document.documentElement.outerHTML);
2525

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

0 commit comments

Comments
 (0)