Skip to content

Commit

Permalink
implementing a migration test file to the latest migration 19
Browse files Browse the repository at this point in the history
  • Loading branch information
tommasini committed Jul 18, 2023
1 parent ec20a98 commit d18bdd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/store/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ export const migrations = {
}
return state;
},
// If you are implementing a migration it will break the migration tests,
// please write a unit for your specific migration version
};

export const version = 19;
6 changes: 3 additions & 3 deletions app/store/migrations.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { migrations, version } from './migrations'; // Import your migrations file
import { migrations, version } from './migrations';

describe('Redux Persist Migrations', () => {
it('should apply last migration and return state', () => {
it('should apply migration number 19 and return state', () => {
let currentState = {};

const migration = migrations[version];
const migration = migrations[19];

currentState = migration(currentState);

Expand Down

0 comments on commit d18bdd7

Please sign in to comment.