0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

Fix prerender getStaticPaths flaky test (#7745)

This commit is contained in:
Bjorn Lu 2023-07-24 15:49:29 +08:00 committed by GitHub
parent da7f1128bf
commit baaf80b27d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,7 +59,11 @@ describe('Prerender', () => {
await devServer.stop();
});
it('only calls prerender getStaticPaths once', async () => {
it('only calls prerender getStaticPaths once', async function () {
// Sometimes this fail in CI as the chokidar watcher triggers an update and invalidates the route cache,
// causing getStaticPaths to be called twice. Workaround this with 2 retries for now.
this.retries(2);
let res = await fixture.fetch('/blog/a');
expect(res.status).to.equal(200);