Files
worldmonitor/tests/seed-warm-ping-origin.test.mjs
Elie Habib 467608c2d7 chore: clear baseline lint debt (173 warnings → 49) (#1712)
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).
2026-03-16 08:48:00 +04:00

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'/);
});
});