aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2018-04-06 10:28:53 +0800
committerfrankiebee <frankie.diamond@gmail.com>2018-04-06 10:33:10 +0800
commitd4e30040a2186a1320a44f86849506729b2dafad (patch)
tree33c8a0cbe3fccfd6d27c3ea06bd242c05bdeb293 /test
parent7d243aacf9db9dc8e3e2e3acfc54298ffc06fe12 (diff)
downloadtangerine-wallet-browser-d4e30040a2186a1320a44f86849506729b2dafad.tar
tangerine-wallet-browser-d4e30040a2186a1320a44f86849506729b2dafad.tar.gz
tangerine-wallet-browser-d4e30040a2186a1320a44f86849506729b2dafad.tar.bz2
tangerine-wallet-browser-d4e30040a2186a1320a44f86849506729b2dafad.tar.lz
tangerine-wallet-browser-d4e30040a2186a1320a44f86849506729b2dafad.tar.xz
tangerine-wallet-browser-d4e30040a2186a1320a44f86849506729b2dafad.tar.zst
tangerine-wallet-browser-d4e30040a2186a1320a44f86849506729b2dafad.zip
migrations - back fixes
Diffstat (limited to 'test')
-rw-r--r--test/unit/migrator-test.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/unit/migrator-test.js b/test/unit/migrator-test.js
index 2bad7da51..4404e1dc4 100644
--- a/test/unit/migrator-test.js
+++ b/test/unit/migrator-test.js
@@ -50,11 +50,19 @@ describe('Migrator', () => {
const migrator = new Migrator({ migrations: liveMigrations })
migrator.migrateData(firstTimeState)
.then((migratedData) => {
- console.log(migratedData)
const last = liveMigrations.length - 1
assert.equal(migratedData.meta.version, liveMigrations[last].version)
done()
}).catch(done)
})
+ it('should emit an error', function (done) {
+ this.timeout(15000)
+ const migrator = new Migrator({ migrations: [{ version: 1, migrate: async () => { throw new Error('test') } } ] })
+ migrator.on('error', () => done())
+ migrator.migrateData({ meta: {version: 0} })
+ .then((migratedData) => {
+ }).catch(done)
+ })
+
})