Skip to content

Commit

Permalink
fix timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
RohinBhargava committed Jan 13, 2025
1 parent de2c846 commit 813ad8d
Showing 1 changed file with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,43 +47,43 @@ for (const fixtureName of [
"no-version-yes-tabs",
]) {
// eslint-disable-next-line vitest/valid-title
describe(
fixtureName,
() => {
it("should work", async () => {
const fixture = readFixture(fixtureName);
const mockGetPresignedDocsAssetsDownloadUrl = vi.fn();
const root = FernNavigation.utils.toRootNode(fixture);
const apis = await FernNavigation.utils.toApis(
fixture,
mockGetPresignedDocsAssetsDownloadUrl
);
const pages = FernNavigation.utils.toPages(fixture);

const { records, tooLarge } = createAlgoliaRecords({
root,
domain: "test.com",
org_id: "test",
pages,
apis,
});

expect(tooLarge.length).toBe(0);

records.forEach((record) => {
if (record.description != null) {
expect(record.description.length).toBeLessThanOrEqual(50_000);
}
describe(fixtureName, () => {
it("should work", async () => {
const fixture = readFixture(fixtureName);
const mockGetPresignedDocsAssetsDownloadUrl = vi.fn();
const root = FernNavigation.utils.toRootNode(fixture);
console.log(`${fixtureName} - a`);
const apis = await FernNavigation.utils.toApis(
fixture,
mockGetPresignedDocsAssetsDownloadUrl
);
console.log(`${fixtureName} - b`);
const pages = FernNavigation.utils.toPages(fixture);
console.log(`${fixtureName} - c`);
const { records, tooLarge } = createAlgoliaRecords({
root,
domain: "test.com",
org_id: "test",
pages,
apis,
});
console.log(`${fixtureName} - d`);
expect(tooLarge.length).toBe(0);
console.log(`${fixtureName} - e`);
records.forEach((record) => {
if (record.description != null) {
expect(record.description.length).toBeLessThanOrEqual(50_000);
}

if (record.type === "markdown" && record.content != null) {
expect(record.content.length).toBeLessThanOrEqual(50_000);
}
});
await expect(JSON.stringify(records, null, 2)).toMatchFileSnapshot(
path.join("__snapshots__", `${fixtureName}.test.ts.json`)
);
if (record.type === "markdown" && record.content != null) {
expect(record.content.length).toBeLessThanOrEqual(50_000);
}
});
},
25_000
);
console.log(`${fixtureName} - f`);
await expect(JSON.stringify(records, null, 2)).toMatchFileSnapshot(
path.join("__snapshots__", `${fixtureName}.test.ts.json`)
);
console.log(`${fixtureName} - g`);
}, 100_000);
});
}

0 comments on commit 813ad8d

Please sign in to comment.