Commit 6f4c3b3 1 parent 09e7f24 commit 6f4c3b3 Copy full SHA for 6f4c3b3
File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -3,38 +3,37 @@ import assert from 'assert'
3
3
import { cloneDeep } from 'lodash'
4
4
import Migrator from '../../../app/scripts/lib/migrator'
5
5
import liveMigrations from '../../../app/scripts/migrations'
6
+ import data from '../../../app/scripts/first-time-state'
6
7
7
8
const stubMigrations = [
8
9
{
9
10
version : 1 ,
10
- migrate : ( data ) => {
11
+ migrate : ( state ) => {
11
12
// clone the data just like we do in migrations
12
- const clonedData = cloneDeep ( data )
13
+ const clonedData = cloneDeep ( state )
13
14
clonedData . meta . version = 1
14
15
return Promise . resolve ( clonedData )
15
16
} ,
16
17
} ,
17
18
{
18
19
version : 2 ,
19
- migrate : ( data ) => {
20
- const clonedData = cloneDeep ( data )
20
+ migrate : ( state ) => {
21
+ const clonedData = cloneDeep ( state )
21
22
clonedData . meta . version = 2
22
23
return Promise . resolve ( clonedData )
23
24
} ,
24
25
} ,
25
26
{
26
27
version : 3 ,
27
- migrate : ( data ) => {
28
- const clonedData = cloneDeep ( data )
28
+ migrate : ( state ) => {
29
+ const clonedData = cloneDeep ( state )
29
30
clonedData . meta . version = 3
30
31
return Promise . resolve ( clonedData )
31
32
} ,
32
33
} ,
33
34
]
34
35
const versionedData = { meta : { version : 0 } , data : { hello : 'world' } }
35
36
36
- import data from '../../../app/scripts/first-time-state'
37
-
38
37
const firstTimeState = {
39
38
meta : { version : 0 } ,
40
39
data,
You can’t perform that action at this time.
0 commit comments