});
it('encrypts and decrypts all available versions no compression', async function () {
- Object.keys(mb.versionParameters).map((v) => Number(v)).forEach(async (version) => {
+ const availableVersions = Object.keys(mb.versionParameters).map((v) => Number(v));
+ for await (const version of availableVersions) {
object = {
foo: 'bar',
baz: 'quux',
const encryptedResult = await mb.pack(object, version, 0x00);
const decryptedResult = await mb.unpack(encryptedResult);
assert.deepStrictEqual(decryptedResult, object, `${version} results not symmetric`);
- });
+ }
});
it('encrypts and decrypts all available versions +brotli', async function () {
- Object.keys(mb.versionParameters).map((v) => Number(v)).forEach(async (version) => {
+ const availableVersions = Object.keys(mb.versionParameters).map((v) => Number(v));
+ for await (const version of availableVersions) {
object = {
foo: 'bar',
baz: 'quux',
const encryptedResult = await mb.pack(object, version, mb.Flags.Brotli);
const decryptedResult = await mb.unpack(encryptedResult);
assert.deepStrictEqual(decryptedResult, object, `${version} results not symmetric`);
- });
+ };
});
it('encrypts and decrypts all available versions +flate', async function () {
- Object.keys(mb.versionParameters).map((v) => Number(v)).forEach(async (version) => {
+ const availableVersions = Object.keys(mb.versionParameters).map((v) => Number(v));
+ for await (const version of availableVersions) {
object = {
foo: 'bar',
baz: 'quux',
const encryptedResult = await mb.pack(object, version, mb.Flags.Flate);
const decryptedResult = await mb.unpack(encryptedResult);
assert.deepStrictEqual(decryptedResult, object, `${version} results not symmetric`);
- });
+ };
});
it('handles large object +brotli', async function () {