mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 06:07:06 +01:00
aa41057628
* eslint: Enable curly and brace-style * yarn lint --fix
20 lines
314 B
JavaScript
20 lines
314 B
JavaScript
const assert = require('assert')
|
|
|
|
module.exports = {
|
|
assertRejects,
|
|
}
|
|
|
|
// assert.rejects added in node v10
|
|
async function assertRejects (asyncFn, regExp) {
|
|
let f = () => {}
|
|
try {
|
|
await asyncFn()
|
|
} catch (error) {
|
|
f = () => {
|
|
throw error
|
|
}
|
|
} finally {
|
|
assert.throws(f, regExp)
|
|
}
|
|
}
|