@@ -10,22 +10,38 @@ import {
1010 testdir ,
1111} from './utils' ;
1212
13- describe . each ( [ 'postinstall' , [ 'build' , '--frozen' ] , [ 'prisma' , 'migrate' , 'status' ] ] ) (
14- '%s' ,
15- command => {
16- test ( 'logs an error and exits with 1 when the schemas do not exist' , async ( ) => {
17- const tmp = await testdir ( {
18- ...symlinkKeystoneDeps ,
19- 'keystone.js' : basicKeystoneConfig ,
20- } ) ;
21- const recording = recordConsole ( ) ;
22- await expect ( runCommand ( tmp , command ) ) . rejects . toEqual ( new ExitError ( 1 ) ) ;
23- expect ( recording ( ) ) . toMatchInlineSnapshot (
24- `"Your Prisma and GraphQL schemas are not up to date"`
25- ) ;
13+ describe . each ( [ 'postinstall' , [ 'build' , '--frozen' ] ] ) ( '%s' , command => {
14+ test ( 'logs an error and exits with 1 when the schemas do not exist' , async ( ) => {
15+ const tmp = await testdir ( {
16+ ...symlinkKeystoneDeps ,
17+ 'keystone.js' : basicKeystoneConfig ,
18+ } ) ;
19+ const recording = recordConsole ( ) ;
20+ await expect ( runCommand ( tmp , command ) ) . rejects . toEqual ( new ExitError ( 1 ) ) ;
21+ expect ( recording ( ) ) . toMatchInlineSnapshot (
22+ `"Your Prisma and GraphQL schemas are not up to date"`
23+ ) ;
24+ } ) ;
25+ } ) ;
26+
27+ describe ( 'prisma migrate status' , ( ) => {
28+ test ( 'logs an error and exits with 1 when the schemas do not exist' , async ( ) => {
29+ const tmp = await testdir ( {
30+ ...symlinkKeystoneDeps ,
31+ 'keystone.js' : basicKeystoneConfig ,
2632 } ) ;
27- }
28- ) ;
33+ await expect ( runCommand ( tmp , [ 'build' , '--no-ui' , '--frozen' ] ) ) . rejects . toEqual (
34+ new ExitError ( 1 )
35+ ) ;
36+ const recording = recordConsole ( ) ;
37+ await expect ( runCommand ( tmp , [ 'prisma' , '--frozen' , 'migrate' , 'status' ] ) ) . rejects . toEqual (
38+ new ExitError ( 1 )
39+ ) ;
40+ expect ( recording ( ) ) . toMatchInlineSnapshot (
41+ `"Your Prisma and GraphQL schemas are not up to date"`
42+ ) ;
43+ } ) ;
44+ } ) ;
2945
3046const schemasMatch = [ 'schema.prisma' , 'schema.graphql' ] ;
3147
0 commit comments