Skip to content

Commit

Permalink
Add sleep function to fix add-domain-to-fbc.test.js test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxxcrawford committed Jul 6, 2023
1 parent fc299e9 commit 248835a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/features/add-domain-to-fbc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ describe("Add domain to Facebook Container", () => {
removeDomain: "example.com"
});

await sleep(300);

const [promise] = await background.browser.runtime.onMessage.addListener.yield({message: "what-sites-are-added"});
const sites = await promise;
expect(sites.includes("example.com")).to.be.false;
Expand All @@ -39,3 +41,7 @@ describe("Add domain to Facebook Container", () => {
});

});

async function sleep(ms = 100) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

0 comments on commit 248835a

Please sign in to comment.