From 6d4fca3bc47a16c642fb25157ee6a4c5c1b680ee Mon Sep 17 00:00:00 2001 From: Nishant Arora <1895906+whizzzkid@users.noreply.github.com> Date: Fri, 8 Sep 2023 17:27:22 -0600 Subject: [PATCH] fix(test): :recycle: simplify scaffolding Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com> --- test/e2e/ipfs-companion.test.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/test/e2e/ipfs-companion.test.js b/test/e2e/ipfs-companion.test.js index 71cdba5cd..a6d1362b7 100644 --- a/test/e2e/ipfs-companion.test.js +++ b/test/e2e/ipfs-companion.test.js @@ -175,21 +175,23 @@ async function runBrowserTest (browserName, testFunc) { } } -async function checkNumberOfConnectedPeers (browser, url) { - const peers = await getNumberOfConnectedPeers(browser, url) - expect(peers).not.to.equal(0) -} - -describe('ipfs-companion', function () { +describe('ipfs-companion', () => { before(function () { if (process.env.TEST_E2E !== 'true') { this.skip() } }) - it('should be able to discover peers in Chromium', async function () { - await runBrowserTest('chromium', checkNumberOfConnectedPeers) - }) - it('should be able to discover peers in Firefox', async function () { - await runBrowserTest('firefox', checkNumberOfConnectedPeers) - }) + + const browsersToTest = ['chromium', 'firefox'] + + for (const browserName of browsersToTest) { + describe(`ipfs-companion in ${browserName}`, () => { + it(`should be able to install the extension in ${browserName}`, async () => { + await runBrowserTest(browserName, async (browser, url) => { + const peers = await getNumberOfConnectedPeers(browser, url) + expect(peers).not.to.equal(0) + }) + }) + }) + } })