test(encryption): add backwards-compatibility-test for encrypt/decrypt
Encryption in this library is historically using tweetnacl and tweetnacl-util as encryption libraries. tweetnacl-util was replaced with @scure/base in #358 and tweetnacl is also due for removal.
This adds a snapshot of encryption.ts as test-legacy-encryption.ts, and adds compatibility tests in both directions to ensure that new versions of the code can decrypt messages produced by the old version and vice-versa.
It does this by wrapping the entire existing encryption-test-suite and injecting the functions under test.
Note for reviewers: Most of the diff in encryption.test.ts is indentation, which can be ignored by git diff -w).
New dependencies detected. Learn more about Socket for GitHub ↗︎
| Package | New capabilities | Transitives | Size | Publisher |
|---|---|---|---|---|
| npm/[email protected] | None | 0 |
8.14 kB | dchest |