From 3da773c27fd313ad0b8f42a7bbbab4f6886e7d5c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 13 Mar 2024 18:39:42 +0000 Subject: [PATCH] Add HTTP tests to npm test command --- core/modules/commands/quit.js | 34 ++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 core/modules/commands/quit.js diff --git a/core/modules/commands/quit.js b/core/modules/commands/quit.js new file mode 100644 index 000000000..a43a3f066 --- /dev/null +++ b/core/modules/commands/quit.js @@ -0,0 +1,34 @@ +/*\ +title: $:/core/modules/commands/quit.js +type: application/javascript +module-type: command + +Immediately ends the TiddlyWiki process + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports.info = { + name: "quit", + synchronous: true +}; + +var Command = function(params,commander,callback) { + var self = this; + this.params = params; + this.commander = commander; + this.callback = callback; +}; + +Command.prototype.execute = function() { + process.exit(); + return null; +}; + +exports.Command = Command; + +})(); diff --git a/package.json b/package.json index 9466b80ae..b3122e471 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "scripts": { "start": "node ./tiddlywiki.js ./editions/multiwikiserver --listen", - "test": "node ./tiddlywiki.js ./editions/test --verbose --version --build index", + "test": "node ./tiddlywiki.js ./editions/test --verbose --version --build index && node ./tiddlywiki ./editions/multiwikiserver/ --listen debug-level=full --mws-test-server http://127.0.0.1:8080/ --quit", "lint:fix": "eslint . --fix", "lint": "eslint ." },