Repository navigation
test(webhooks): isolate Discord hardening mocks - #1691
Conversation
|
Reproducer for the order dependence (run in // __tests__/unit/aaa-load-discord-route.test.js (temporary)
jest.mock('../../models/DiscordIntegration', () => ({ findOne: jest.fn() }));
require('../../routes/webhooks/discord');
test('loads', () => expect(true).toBe(true));// wren-seq.js (temporary; forces the loader file first)
const Sequencer = require('@jest/test-sequencer').default;
class S extends Sequencer { sort(t) { return [...t].sort(a => (a.path.includes('aaa-load-discord-route') ? -1 : 1)); } }
module.exports = S;Mechanism: jest-runner creates one |
c8e423d to
40fe05e
Compare
Summary
Verification
CI=true npx jest __tests__/unit/routes/discord.webhook.hardening.test.js --runInBand --no-cacheCI=true npx jest __tests__/unit/security/leakMatrix.integrations.test.js __tests__/unit/routes/discord.webhook.hardening.test.js --runInBand --no-cachenpx eslint __tests__/unit/routes/discord.webhook.hardening.test.js