@@ -2,42 +2,6 @@ import * as sourceMapSupport from 'source-map-support';
2
2
sourceMapSupport . install ( ) ;
3
3
4
4
import factoryTest from './factoryTest' ;
5
- import LockedMigrationsError from './utils/errors/LockedMigrationsError' ;
6
- import ProcessedMigration from './utils/types/ProcessedMigration' ;
5
+ import testRepoFactory from './utils/tests/testRepoFactory' ;
7
6
8
- let processedMigrations : ProcessedMigration [ ] = [ ] ; // tslint:disable-line:no-let
9
- let hasLockedMigrations = false ; // tslint:disable-line:no-let
10
-
11
- factoryTest ( ( migrations ) => {
12
- return {
13
- clearMigrations : async ( ) => {
14
- processedMigrations = [ ] ;
15
- } ,
16
- getMigrations : async ( ) => {
17
- return migrations ;
18
- } ,
19
- getProcessedMigrations : async ( ) => {
20
- return processedMigrations ;
21
- } ,
22
- lockMigrations : async ( ) => {
23
- if ( hasLockedMigrations ) {
24
- throw new LockedMigrationsError ( ) ;
25
- }
26
- hasLockedMigrations = true ;
27
- } ,
28
- removeProcessedMigration : async ( key ) => {
29
- processedMigrations = processedMigrations . filter ( ( processedMigration ) => {
30
- return processedMigration . key !== key ;
31
- } ) ;
32
- } ,
33
- unlockMigrations : async ( ) => {
34
- hasLockedMigrations = false ;
35
- } ,
36
- updateProcessedMigration : async ( migration ) => {
37
- const unmatchedMigrations = processedMigrations . filter ( ( processedMigration ) => {
38
- return processedMigration . key !== migration . key ;
39
- } ) ;
40
- processedMigrations = [ ...unmatchedMigrations , migration ] ;
41
- } ,
42
- } ;
43
- } ) ;
7
+ factoryTest ( testRepoFactory ) ;
0 commit comments