You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
* test: adds automated tests to browser examples
* chore: upgrade chrome
* chore: throw on unhandled rejection
* fix: fail if FAILED is in output
* chore: exit with same exit code as nightwatch
* chore: fix element id
* test: add assertion
* chore: add video streaming test
* chore: change dist url
* chore: build IPFS for basic browser demos
* test: add some node tests
* test: adds some more tests. ethereum one is a little wobbly
* chore: accept bundle as build script
* test: add final few tests
* test: control assertion timeouts with global
* test: wait for other peer to join workspace before sending file
* chore: tidy up deps
Copy file name to clipboardExpand all lines: examples/README.md
+24
Original file line number
Diff line number
Diff line change
@@ -49,3 +49,27 @@ In this section, you will find explanations to different pieces of IPFS Architec
49
49
- Storing and Retrieving blocks (soon™)
50
50
- IPLD (InterPlanetary Linked-Data) (soon™)
51
51
- IPFS Networking - Managing your swarm, libp2p and more (soon™)
52
+
53
+
## Adding new examples
54
+
55
+
All examples should include a `test.js` file. The implementation will differ depending on if your example is intended to run under node or the browser.
56
+
57
+
### Browser `test.js`
58
+
59
+
All browser examples should either be a whole webapp or a simple demo (e.g. just `index.html` and `index.js` files).
60
+
61
+
#### Webapp
62
+
63
+
Webapps must have a `package.json` that contains either a `build` or a `bundle` script. This script should place all assets in a folder named `dist`, `build` or `public` including an `index.html` file. During testing this will have a web server run over it using `http-server`.
64
+
65
+
#### Simple demo
66
+
67
+
Simple demos must have an `index.html` file in the root of the demo folder. This file will be loaded in a browser and tested via a `file://` URL.
68
+
69
+
#### Browser `test.js`
70
+
71
+
Your `test.js` file should contain a [Nightwatch](https://www.npmjs.com/package/nightwatch) scenario that will be executed. The URL to example will be present in the `IPFS_EXAMPLE_TEST_URL` environmental variable when the test is run.
72
+
73
+
### Node
74
+
75
+
Your `test.js` file should export an async function that sets up your test, runs any assertions, tears down anything set up and throws an error if the test fails.
0 commit comments