From 9f95a75f42bde2960b2a075e8b2adf36506ec61a Mon Sep 17 00:00:00 2001 From: Patrick Canfield Date: Wed, 8 Nov 2023 15:45:51 -0800 Subject: [PATCH] make sure all tests run --- package.json | 5 +++-- test.ts | 7 +++++++ yarn.lock | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 test.ts diff --git a/package.json b/package.json index c05713ab..96646293 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "scripts": { "start": "nodemon start.ts", "build": "parcel build", - "test": "NODE_ENV=test ts-node --esm --experimentalSpecifierResolution=node src/*.test.ts", - "test-dev": "NODE_OPTIONS=\"--max_old_space_size=8192\" NODE_ENV=test nodemon --experimentalSpecifierResolution=node src/*.test.ts -w \"src/*.ts\"" + "test": "NODE_ENV=test ts-node --transpileOnly --esm --experimentalSpecifierResolution=node test.ts", + "test-dev": "NODE_OPTIONS=\"--max_old_space_size=8192\" NODE_ENV=test nodemon --transpileOnly --experimentalSpecifierResolution=node test.ts -w \"src/**/*.ts\"" }, "devDependencies": { "@parcel/config-default": "^2.10.0", @@ -19,6 +19,7 @@ "@types/ws": "^8.5.8", "chokidar": "^3.5.3", "debounce": "^1.2.1", + "glob": "^10.3.10", "parcel": "^2.10.0", "prettier": "^3.0.3", "process": "^0.11.10", diff --git a/test.ts b/test.ts new file mode 100644 index 00000000..d3d44fe5 --- /dev/null +++ b/test.ts @@ -0,0 +1,7 @@ +import { sync } from "glob"; + +const files = sync("./src/**/*.test.ts"); +for (const file of files) { + console.log(`Running ${file}`); + await import(`./${file}`); +} diff --git a/yarn.lock b/yarn.lock index 18aaa783..363e3d26 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2535,7 +2535,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.2.2": +"glob@npm:^10.2.2, glob@npm:^10.3.10": version: 10.3.10 resolution: "glob@npm:10.3.10" dependencies: @@ -3562,6 +3562,7 @@ __metadata: "@types/ws": ^8.5.8 chokidar: ^3.5.3 debounce: ^1.2.1 + glob: ^10.3.10 lodash: ^4.17.21 nodemon: ^3.0.1 parcel: ^2.10.0