packaging: npm configuration

This commit is contained in:
Jeremy Wall 2024-04-03 17:47:01 -04:00
parent 431b25cdfd
commit 4d73f75ec8
5 changed files with 68 additions and 24 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules/

24
package-lock.json generated Normal file
View File

@ -0,0 +1,24 @@
{
"name": "test-tap",
"version": "0.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "test-tap",
"version": "0.0.1",
"license": "Artistic-2.0",
"dependencies": {
"esm": "^3.2.25"
}
},
"node_modules/esm": {
"version": "3.2.25",
"resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
"integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
"engines": {
"node": ">=6"
}
}
}
}

34
package.json Normal file
View File

@ -0,0 +1,34 @@
{
"name": "test-tap",
"version": "0.0.1",
"description": "Test-Tap a 0 dependency single file Test Anything Protocol library",
"type": "module",
"directories": {
"test": "tests",
"lib": "src"
},
"files": [
"src/*.mjs",
"src/*.js"
],
"scripts": {
"test": "node tests/01_tap.t.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/zaphar/test-tap.git"
},
"keywords": [
"testing",
"tap"
],
"author": "Jeremy Wall (jeremy@marzhillstudios.com)",
"license": "Artistic-2.0",
"bugs": {
"url": "https://github.com/zaphar/test-tap/issues"
},
"homepage": "https://github.com/zaphar/test-tap#readme",
"dependencies": {
"esm": "^3.2.25"
}
}

View File

@ -1,23 +1,8 @@
/** @implements TapRenderer */
class FakeRenderer {
output = "nothing yet";
commentOutput = "";
import { Tap, runTest } from '../src/Tap.mjs';
import { tapSuite } from './suite.mjs';
out(text) {
this.output = text;
}
comment(lines) {
for (var line of lines) {
this.commentOutput += line;
}
}
}
import('./suite.mjs').then(async m => {
const pair = m.Tap.Node();
m.runTest(pair.Tap, "Tap dogfood test suite", m.tapSuite);
// Note output requires some async machinery because it uses some dynamic inputs.
await pair.Renderer.renderAll();
process.exit(pair.Tap.isPass() ? 0 : 1);
});
const pair = Tap.Node();
runTest(pair.Tap, "Tap dogfood test suite", tapSuite);
// Note output requires some async machinery because it uses some dynamic inputs.
await pair.Renderer.renderAll();
process.exit(pair.Tap.isPass() ? 0 : 1);

View File

@ -1,5 +1,5 @@
/** @implements TapRenderer */
import {Tap, runTest, NodeRenderer, BrowserRenderer} from '../src/TAP.mjs';
import { Tap } from '../src/Tap.mjs';
class FakeRenderer {
output = "nothing yet";
@ -159,4 +159,4 @@ function tapSuite(t) {
return t;
}
export { tapSuite, runTest, Tap };
export { tapSuite };