@@ -97,8 +97,17 @@ describe("run", () => {
9797 expect ( setFailed ) . toHaveBeenCalledWith ( expect . stringContaining ( "Flyway is not installed" ) ) ;
9898 } ) ;
9999
100- it ( "should fail when neither url nor environment is provided " , async ( ) => {
100+ it ( "should fail for non-enterprise edition " , async ( ) => {
101101 setupFlywayMock ( { edition : "Community" , prepareExitCode : 0 } ) ;
102+
103+ await import ( "../src/main.js" ) ;
104+ await vi . dynamicImportSettled ( ) ;
105+
106+ expect ( setFailed ) . toHaveBeenCalledWith ( expect . stringContaining ( "require Flyway Enterprise edition" ) ) ;
107+ } ) ;
108+
109+ it ( "should fail when neither url nor environment is provided" , async ( ) => {
110+ setupFlywayMock ( { edition : "Enterprise" , driftExitCode : 0 , prepareExitCode : 0 } ) ;
102111 getInput . mockReturnValue ( "" ) ;
103112
104113 await import ( "../src/main.js" ) ;
@@ -221,24 +230,6 @@ describe("run", () => {
221230 expect ( setFailed ) . not . toHaveBeenCalled ( ) ;
222231 } ) ;
223232
224- it ( "should skip drift check for community edition" , async ( ) => {
225- setupFlywayMock ( {
226- edition : "Community" ,
227- codeReviewExitCode : 0 ,
228- prepareExitCode : 0 ,
229- prepareOutput : { scriptFilename : "deployments/D__deployment.sql" } ,
230- } ) ;
231- getInput . mockImplementation ( ( name : string ) => ( name === "target-url" ? "jdbc:sqlite:test.db" : "" ) ) ;
232-
233- await import ( "../src/main.js" ) ;
234- await vi . dynamicImportSettled ( ) ;
235-
236- expect ( getDriftCheckCalls ( ) ) . toHaveLength ( 0 ) ;
237- expect ( getPrepareCalls ( ) ) . toHaveLength ( 1 ) ;
238- expect ( info ) . toHaveBeenCalledWith ( expect . stringContaining ( "edition is not Enterprise" ) ) ;
239- expect ( setFailed ) . not . toHaveBeenCalled ( ) ;
240- } ) ;
241-
242233 it ( "should proceed with prepare when no drift detected for enterprise edition" , async ( ) => {
243234 setupFlywayMock ( {
244235 edition : "Enterprise" ,
@@ -336,7 +327,8 @@ describe("run", () => {
336327
337328 it ( "should call runCheckChanges" , async ( ) => {
338329 setupFlywayMock ( {
339- edition : "Community" ,
330+ edition : "Enterprise" ,
331+ driftExitCode : 0 ,
340332 codeReviewExitCode : 0 ,
341333 prepareExitCode : 0 ,
342334 prepareOutput : { scriptFilename : "deployments/D__deployment.sql" } ,
@@ -346,7 +338,7 @@ describe("run", () => {
346338 await import ( "../src/main.js" ) ;
347339 await vi . dynamicImportSettled ( ) ;
348340
349- expect ( runCheckChanges ) . toHaveBeenCalledWith ( expect . any ( Object ) , "community " ) ;
341+ expect ( runCheckChanges ) . toHaveBeenCalledWith ( expect . any ( Object ) , "enterprise " ) ;
350342 } ) ;
351343
352344 it ( "should skip code review when skip-code-review is enabled" , async ( ) => {
0 commit comments