Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
chore: consistent browser examples (#3204)
Browse files Browse the repository at this point in the history
This PR aims to turn browser examples naming consistent. Only the directories were renamed to be prefixed by `browser-*` like the other examples. I was always trying to find the exchange files example in the browser and I was always wrongly directioned by the `browser-*` naming, where it was not.

Co-authored-by: achingbrain <[email protected]>
  • Loading branch information
vasco-santos and achingbrain authored Aug 4, 2020
1 parent cc41a96 commit 363cb35
Show file tree
Hide file tree
Showing 26 changed files with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions examples/test-ipfs-example/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ testExample(dir)
})

async function testExample (dir) {
//await installDeps(dir)
await build(dir)

if (dir.includes('examples/browser-')) {
await runBrowserTest(dir)
const test = require(path.join(dir, 'test.js'))

if (typeof test === 'function') {
console.info('Running tests in', dir)

await test()
} else {
await runNodeTest(dir)
await runBrowserTest(dir)
}

process.exit(0)
}

async function build (dir) {
Expand Down Expand Up @@ -92,13 +97,3 @@ async function runBrowserTest (dir) {
server.stop()
}
}

async function runNodeTest (dir) {
console.info('Running node tests in', dir)

const runTest = require(path.join(dir, 'test.js'))

await runTest()

process.exit(0)
}

0 comments on commit 363cb35

Please sign in to comment.