Files
discord.js/packages/voice/__tests__/Secretbox.test.ts
pat 9f8b9b1d66 feat(voice)!: add new encryption methods, remove old methods (#10451)
BREAKING CHANGE: This library no longer supports using `tweetnacl` as an encryption library due to Discord deprecating the algorithms that `tweetnacl` helped us support (read more [here](https://discord.com/developers/docs/change-log#voice-encryption-modes)). Please migrate to one of: `sodium-native`, `sodium`, `@stablelib/xchacha20poly1305`, `@noble/ciphers` or `libsodium-wrappers` unless your system supports `aes-256-gcm` (verify by running `require('node:crypto').getCiphers().includes('aes-256-gcm')`).

---------

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
2024-11-18 00:08:51 +02:00

13 lines
477 B
TypeScript

import { test, expect, vitest } from 'vitest';
import { methods, secretboxLoadPromise } from '../src/util/Secretbox';
vitest.mock('@noble/ciphers/chacha');
// TODO: what is this even testing exactly?
test.skip('Does not throw error with a package installed', async () => {
// The async loop in Secretbox will not have finished importing unless we wait
await secretboxLoadPromise;
expect(() => methods.crypto_aead_xchacha20poly1305_ietf_decrypt()).not.toThrowError();
});