1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

test - stub provider needs to handle errors

This commit is contained in:
kumavis 2018-01-17 19:19:20 -08:00
parent 29a6da0d01
commit 2b9781ab4c

View File

@ -24,7 +24,7 @@ function createEthJsQueryStub (stubProvider) {
get: (obj, method) => {
return (...params) => {
return new Promise((resolve, reject) => {
stubProvider.sendAsync({ method: `eth_${method}`, params }, (err, ress) => resolve(ress.result))
stubProvider.sendAsync({ method: `eth_${method}`, params }, (err, res) => err ? reject(err) : resolve(res.result))
})
}
},
@ -35,4 +35,4 @@ function createStubedProvider (resultStub) {
const engine = createEngineForTestData()
engine.push(scaffoldMiddleware(resultStub))
return providerFromEngine(engine)
}
}