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,