diff --git a/configuration/default.mjs b/configuration/default.mjs new file mode 100644 index 0000000..e69de29 diff --git a/package-lock.json b/package-lock.json index d209c1d..34b1d33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ }, "devDependencies": { "caxa": "^3.0.1", + "cross-env": "^7.0.3", "got": "^12.5.2", "nodemailer": "^6.8.0", "nodemon": "^2.0.20", @@ -1466,6 +1467,24 @@ "node": ">= 10" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -8029,6 +8048,15 @@ "readable-stream": "^3.4.0" } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/package.json b/package.json index e7f0276..468571d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "prepare": "(cd ./server/ && npm run prepare && cd ..) && (cd ./static/ && npm run prepare && cd ..)", "start": "nodemon --watch \"./server/**/*.mts\" --watch \"./static/{{prepare,leafac--javascript}.mjs,**/*.{png,jpeg,ico}}\" --watch \"./configuration/**/*.mjs\" --ext \"*\" --exec \"npm run prepare && node ./build/server/index.mjs ./configuration/development.mjs\"", "start:clean:data": "npm run clean:data && npm run start", - "test": "prettier --check \"./server/**/*.mts\" --check \"./static/prepare.mjs\" --check \"./configuration/**/*.mjs\" --end-of-line auto", + "test": "prettier --check \"./server/**/*.mts\" --check \"./static/prepare.mjs\" --check \"./configuration/**/*.mjs\" --end-of-line auto && npm run prepare && cross-env TEST=kill-the-newsletter node ./build/server/index.mjs", "clean:all": "npm run clean:build && npm run clean:data && npm run clean:node_modules", "clean:build": "shx rm -rf ./build/", "clean:data": "shx rm -rf ./data/", @@ -47,6 +47,7 @@ }, "devDependencies": { "caxa": "^3.0.1", + "cross-env": "^7.0.3", "got": "^12.5.2", "nodemailer": "^6.8.0", "nodemon": "^2.0.20", diff --git a/server/index.mts b/server/index.mts index e69de29..55f14e3 100644 --- a/server/index.mts +++ b/server/index.mts @@ -0,0 +1,5 @@ +import assert from "node:assert/strict"; + +if (process.env.TEST === "kill-the-newsletter") { + assert.equal(1 + 1, 2); +}