MCPcopy Create free account
hub / github.com/EOSIO/eosjs-api / throws

Function throws

src/process-args.test.js:108–118  ·  view source on GitHub ↗
(fn, match)

Source from the content-addressed store, hash-verified

106
107/* istanbul ignore next */
108function throws (fn, match) {
109 try {
110 fn()
111 assert(false, 'Expecting error')
112 } catch (error) {
113 if (!match.test(error)) {
114 error.message = `Error did not match ${match}\n${error.message}`
115 throw error
116 }
117 }
118}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected