cyberchef/tests/node/index.mjs
Sanjays2402 7fea6c79a4 fix: stop Parse QR Code from participating in Magic (#2610)
Parse QR Code declared a `checks` regex that matched any JPEG, PNG,
GIF, WEBP or BMP magic bytes. Magic aggregates every operation with a
`checks` property and runs them, so any image input triggered a full
QR parse attempt that produced a 'Could not read a QR code from the
image' warning in the browser console for every image, even when no QR
code was present.

There is no cheap way to detect a QR code without attempting a full
parse, so Parse QR Code should not participate in Magic. Users can add
it manually when they know the image contains a QR code.

Adds a regression test asserting Parse QR Code declares no `checks`.
2026-06-27 06:32:12 -07:00

46 lines
1.0 KiB
JavaScript

/* eslint no-console: 0 */
/**
* Node API Test Runner
*
* @author d98762625 [d98762625@gmail.com]
* @author tlwr [toby@toby.codes]
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
import {
setLongTestFailure,
logTestReport,
} from "../lib/utils.mjs";
import TestRegister from "../lib/TestRegister.mjs";
import "./tests/nodeApi.mjs";
import "./tests/operations.mjs";
import "./tests/PGP.mjs";
import "./tests/File.mjs";
import "./tests/Dish.mjs";
import "./tests/NodeDish.mjs";
import "./tests/Utils.mjs";
import "./tests/Categories.mjs";
import "./tests/lib/BigIntUtils.mjs";
import "./tests/lib/ChartsProtocolPrototypePollution.mjs";
import "./tests/ParseQRCode.mjs";
const testStatus = {
allTestsPassing: true,
counts: {
total: 0,
}
};
setLongTestFailure();
const logOpsTestReport = logTestReport.bind(null, testStatus);
(async function() {
const results = await TestRegister.runApiTests();
logOpsTestReport(results);
})();