Browse Source

Migration V1 halt case

pull/1/head
Tim Glasgow 2 years ago
parent
commit
ca7298d91f
  1. 9
      squarenotsquare/__tests__/Migration-test.js

9
squarenotsquare/__tests__/Migration-test.js

@ -22,3 +22,12 @@ test('Realm migrates to V1', () => {
expect(newRealm[System.name][0].key).toBe('username');
expect(newRealm[System.name][0].value).toBe('changeme');
})
test('Realm halts V1 migration when schema is V2+', () => {
let oldRealm = new MockRealm(2);
newRealm = new MockRealm(1);
migratev1(oldRealm, newRealm);
oldRealm.create(System.name, {key: 'key1', value: 'value'})
expect(oldRealm[System.name].length).toBe(1);
})
Loading…
Cancel
Save