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

Commit 363cb35

Browse files
chore: consistent browser examples (#3204)
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]>
1 parent cc41a96 commit 363cb35

26 files changed

+9
-14
lines changed

examples/test-ipfs-example/test.js

+9-14
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@ testExample(dir)
2222
})
2323

2424
async function testExample (dir) {
25-
//await installDeps(dir)
2625
await build(dir)
2726

28-
if (dir.includes('examples/browser-')) {
29-
await runBrowserTest(dir)
27+
const test = require(path.join(dir, 'test.js'))
28+
29+
if (typeof test === 'function') {
30+
console.info('Running tests in', dir)
31+
32+
await test()
3033
} else {
31-
await runNodeTest(dir)
34+
await runBrowserTest(dir)
3235
}
36+
37+
process.exit(0)
3338
}
3439

3540
async function build (dir) {
@@ -92,13 +97,3 @@ async function runBrowserTest (dir) {
9297
server.stop()
9398
}
9499
}
95-
96-
async function runNodeTest (dir) {
97-
console.info('Running node tests in', dir)
98-
99-
const runTest = require(path.join(dir, 'test.js'))
100-
101-
await runTest()
102-
103-
process.exit(0)
104-
}

0 commit comments

Comments
 (0)