openpgpjs/test/general/testInputs.js
larabr d49d92e5cb Update to Mocha v10 in tests, declare lib as module and add exports to package.json
Mocha v10 requires the lib to be esm compliant.
ESM mandates the use of file extensions in imports, so to minimize the
changes (for now), we rely on the flag `experimental-specifier-resolution=node`
and on `ts-node` (needed only for Node 20).

Breaking changes:
downstream bundlers might be affected by the package.json changes depending on
how they load the library.
NB: legacy package.json entrypoints are still available.
2023-10-25 12:53:10 +02:00

18 lines
494 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Generates a 64 character long javascript string out of the whole utf-8 range.
*/
function createSomeMessage() {
const arr = [];
for (let i = 0; i < 30; i++) {
arr.push(Math.floor(Math.random() * 10174) + 1);
}
for (let i = 0; i < 10; i++) {
arr.push(0x1F600 + Math.floor(Math.random() * (0x1F64F - 0x1F600)) + 1);
}
return ' \t' + String.fromCodePoint(...arr).replace(/[\r\u2028\u2029]/g, '\n') + ' \t\n한국어/조선말';
}
export {
createSomeMessage
};