Commit 948966a5 authored by Stefan Cameron's avatar Stefan Cameron

Add live-server and html manual test harnesses

parent 1c53811c
Pipeline #32613216 passed with stages
in 2 minutes and 36 seconds
......@@ -26,7 +26,8 @@ The following npm commands will get you started:
* Use Mocha's `describe.only()` and `it.only()` helpers to isolate the test you want to debug, but be sure to remove them when you're done, otherwise coverage will fail.
* `test:coverage`: Checks for code coverage after running unit tests, outputs to `/coverage`
* `lint`: Checks the code for lint.
* `start`: Builds the library, starts Node.js in debug mode (with `--inspect`) and automatically loads the library into the global environment as `rtv` (along with `lodash` as `ld`) by running the following script: `/tolls/node.js`
* `start`: Builds the library, starts Node.js in debug mode (with `--inspect`), and automatically loads the library into the global environment as `rtv` (along with `lodash` as `ld`, and `Object.prototype.toString` as `ostr`) by running the following script: `/tools/node.js`
* `html`: Builds the library and starts `live-server` at http://localhost:8080 with a root of `/tools` where you can load any of the HTML files in that directory to manually test the build in a browser: [UMD](http://localhost:8080/rtvjs-umd.html) or [ESM](http://localhost:8080/rtvjs-esm.html).
See `/package.json` scripts for other commands.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -22,9 +22,6 @@
"clean:lib": "rm -rf ./dist",
"clean": "npm run clean:lib && npm run clean:internals",
"start": "npm run build:lib && npm run node",
"node": "node -r ./tools/node.js --inspect",
"node:build": "npm run build:lib && npm run node",
"node:internals": "npm run build:internals && node -r ./dist_tools/internals.js --inspect",
"build:internals": "npm run clean:internals && rollup -c tools/rollup.internals.js",
"build:lib": "npm run clean:lib && BABEL_ENV=build rollup -c",
"build": "npm run build:lib",
......@@ -35,6 +32,11 @@
"test:unit:debug": "npm run test:unit -- --inspect-brk",
"test:coverage": "nyc npm run test:unit",
"test": "npm run lint && npm run test:coverage",
"node": "node -r ./tools/node.js --inspect",
"node:build": "npm run build:lib && npm run node",
"node:internals": "npm run build:internals && node -r ./dist_tools/internals.js --inspect",
"html": "npm run build:lib && npm run html:live",
"html:live": "live-server --no-browser --mount=\"/dist:./dist\" ./tools",
"preversion": "npm test",
"postversion": "git push && git push --tags",
"prepublish:checkdocs": "git diff HEAD --exit-code -- API.md",
......@@ -95,6 +97,7 @@
"babel-plugin-istanbul": "^5.0.1",
"chai": "^4.1.2",
"eslint": "^5.5.0",
"live-server": "^1.2.0",
"mocha": "^5.2.0",
"nyc": "^13.0.1",
"sinon": "^6.2.0"
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=768, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>RTV.js - ESM</title>
<script type="module">
import rtv from './dist/rtv.esm.js';
window.rtv = rtv;
</script>
</head>
<body>
<p style="text-align: center; margin-top: 20px">
RTV.js is loaded into <b>window.rtv</b> from the ESM (ES6 module) build.
</p>
<p style="text-align: center; margin-top: 10px">
<a href="rtvjs-umd.html">Switch to the UMD build</a>
</p>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=768, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>RTV.js - UMD</title>
<script src="./dist/rtv.umd.js"></script>
</head>
<body>
<p style="text-align: center; margin-top: 20px">
RTV.js is loaded into <b>window.rtv</b> from the UMD build.
</p>
<p style="text-align: center; margin-top: 10px">
<a href="rtvjs-esm.html">Switch to the ESM build</a>
</p>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment