diff --git a/squarenotsquare/__tests__/Migration-test.js b/squarenotsquare/__tests__/Migration-test.js index 565c82f..f86722b 100644 --- a/squarenotsquare/__tests__/Migration-test.js +++ b/squarenotsquare/__tests__/Migration-test.js @@ -21,4 +21,13 @@ 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); }) \ No newline at end of file