tests: consolidate into tests/ dirs, fix import paths

Move all test files out of source dirs into per-workspace tests/:
- shared/tests/   (3 unit test files)
- server/tests/   (1 integration test)
- src/tests/      (8 characterization + scenario tests + testHelpers)

Fix all relative import paths (App, storage, __mocks__, testHelpers).
Fix jest.config testMatch globs in shared/ and server/ (rootDir +
<rootDir>/tests pattern).

Delete scripts/repro-pause-bug.js (debug scratch, superseded by
turn.pause-add.test.js).

Keep scripts/replay-combat.js + scripts/audit-rotation.js as manual
demo/exploratory tools (NOT unit tests, not deterministic).

No logic changes. All green: shared 49 + 1 validated RED, server 23,
FE 62. Scenario test unchanged (240s timeout, pre-existing slow).
This commit is contained in:
david raistrick
2026-06-29 16:02:22 -04:00
parent 33e0e52789
commit f81308a0df
16 changed files with 26 additions and 100 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
module.exports = {
rootDir: '.',
testEnvironment: 'node',
testMatch: ['**/*.test.js'],
testMatch: ['<rootDir>/tests/**/*.test.js'],
testTimeout: 10000,
};
@@ -10,9 +10,9 @@
const path = require('path');
const os = require('os');
const { createServer } = require('../server/index');
const { createWsStorage } = require('../src/storage/ws');
const { runStorageContract } = require('../src/storage/contract');
const { createServer } = require('../index');
const { createWsStorage } = require('../../src/storage/ws');
const { runStorageContract } = require('../../src/storage/contract');
let nextPort = 4000 + Math.floor(Math.random() * 999);