From 6f4c3b34058f6403f0208bbfe761e0287cc5dc38 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 18 Aug 2020 16:54:47 -0230 Subject: [PATCH] Tidy up Migrator tests (#9264) --- test/unit/migrations/migrator-test.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/unit/migrations/migrator-test.js b/test/unit/migrations/migrator-test.js index 3cf08c355..de4d16c45 100644 --- a/test/unit/migrations/migrator-test.js +++ b/test/unit/migrations/migrator-test.js @@ -3,29 +3,30 @@ import assert from 'assert' import { cloneDeep } from 'lodash' import Migrator from '../../../app/scripts/lib/migrator' import liveMigrations from '../../../app/scripts/migrations' +import data from '../../../app/scripts/first-time-state' const stubMigrations = [ { version: 1, - migrate: (data) => { + migrate: (state) => { // clone the data just like we do in migrations - const clonedData = cloneDeep(data) + const clonedData = cloneDeep(state) clonedData.meta.version = 1 return Promise.resolve(clonedData) }, }, { version: 2, - migrate: (data) => { - const clonedData = cloneDeep(data) + migrate: (state) => { + const clonedData = cloneDeep(state) clonedData.meta.version = 2 return Promise.resolve(clonedData) }, }, { version: 3, - migrate: (data) => { - const clonedData = cloneDeep(data) + migrate: (state) => { + const clonedData = cloneDeep(state) clonedData.meta.version = 3 return Promise.resolve(clonedData) }, @@ -33,8 +34,6 @@ const stubMigrations = [ ] const versionedData = { meta: { version: 0 }, data: { hello: 'world' } } -import data from '../../../app/scripts/first-time-state' - const firstTimeState = { meta: { version: 0 }, data,