mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
Mechanical fixes across 13 files: - isNaN() → Number.isNaN() (all values already numeric from parseFloat/parseInt) - let → const where never reassigned - Math.pow() → ** operator - Unnecessary continue in for loop - Useless string escape in test description - Missing parseInt radix parameter - Remove unused private class member (write-only counter) - Prefix unused function parameter with _ Config: suppress noImportantStyles (CSS !important is intentional) and useLiteralKeys (bracket notation used for computed/dynamic keys) in biome.json. Remaining 49 warnings are all noExcessiveCognitiveComplexity (already configured as warn, safe to address incrementally).
27 lines
965 B
JavaScript
27 lines
965 B
JavaScript
import { describe, it } from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
import { dirname, resolve } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
const root = resolve(__dirname, '..');
|
|
|
|
function readScript(relativePath) {
|
|
return readFileSync(resolve(root, relativePath), 'utf-8');
|
|
}
|
|
|
|
describe('warm-ping seed scripts', () => {
|
|
it('sends the app Origin header for infrastructure warm-pings', () => {
|
|
const src = readScript('scripts/seed-infra.mjs');
|
|
assert.match(src, /Origin:\s*'https:\/\/worldmonitor\.app'/);
|
|
assert.match(src, /method:\s*'POST'/);
|
|
});
|
|
|
|
it('sends the app Origin header for military/maritime warm-pings', () => {
|
|
const src = readScript('scripts/seed-military-maritime-news.mjs');
|
|
assert.match(src, /Origin:\s*'https:\/\/worldmonitor\.app'/);
|
|
assert.match(src, /method:\s*'POST'/);
|
|
});
|
|
});
|