diff options
author | Mario <mario@mariovavti.com> | 2024-03-10 22:38:21 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-03-10 22:38:21 +0000 |
commit | 360713c6896d18a95dd3ca541ea477bf44b98d0c (patch) | |
tree | 8acaa683b277023aa4842f25b04623ae196fa1ae /library/sodium-plus/test/async-helper.js | |
parent | ee8aba3221f995b265c3196505a1c7c26b76f116 (diff) | |
download | volse-hubzilla-360713c6896d18a95dd3ca541ea477bf44b98d0c.tar.gz volse-hubzilla-360713c6896d18a95dd3ca541ea477bf44b98d0c.tar.bz2 volse-hubzilla-360713c6896d18a95dd3ca541ea477bf44b98d0c.zip |
add sodium-plus js crypto library
Diffstat (limited to 'library/sodium-plus/test/async-helper.js')
-rw-r--r-- | library/sodium-plus/test/async-helper.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/library/sodium-plus/test/async-helper.js b/library/sodium-plus/test/async-helper.js new file mode 100644 index 000000000..d3b5ebc00 --- /dev/null +++ b/library/sodium-plus/test/async-helper.js @@ -0,0 +1,13 @@ +const { expect } = require('chai'); +module.exports = async function expectError(promised, message) { + let thrown = false; + try { + await promised; + } catch (e) { + thrown = true; + expect(message).to.be.equal(e.message); + } + if (!thrown) { + throw new Error('Function did not throw'); + } +}; |