@@ -4,7 +4,7 @@ import { ReportSteps } from "../helpers/constants.js"
44import { getAddCommand } from "../helpers/commands.js"
55import { report } from "../helpers/reporter.js"
66import { reportCmd , cmd } from "../helpers/cmd.js"
7- import { setRollback } from "../helpers/rollback.js"
7+ import { queueRollback } from "../helpers/rollback.js"
88import { setRootVersion } from "../helpers/set-root-version.js"
99import { runNpm } from "../modules/npm.js"
1010import { runIncrement } from "../modules/increment.js"
@@ -21,7 +21,7 @@ jest.mock("../helpers/set-root-version.js", () => ({
2121 setRootVersion : jest . fn ( ) ,
2222} ) )
2323jest . mock ( "../helpers/rollback.js" , ( ) => ( {
24- setRollback : jest . fn ( ) ,
24+ queueRollback : jest . fn ( ) ,
2525} ) )
2626jest . mock ( "../modules/increment.js" , ( ) => ( {
2727 runIncrement : jest . fn ( ) ,
@@ -140,14 +140,27 @@ describe("runNpm()", () => {
140140 // When
141141 await runNpm ( config )
142142 // Then
143- expect ( setRollback ) . toBeCalledWith (
143+ expect ( queueRollback ) . toBeCalledWith (
144144 expect . objectContaining ( config ) ,
145145 expect . objectContaining ( {
146146 type : "increment" ,
147147 callback : expect . any ( Function ) ,
148148 } )
149149 )
150150 } )
151+
152+ it ( "adds publish action" , async ( ) => {
153+ // when
154+ await runNpm ( config )
155+ // Then
156+ expect ( queueRollback ) . toBeCalledWith (
157+ expect . objectContaining ( config ) ,
158+ expect . objectContaining ( {
159+ type : "publish" ,
160+ callback : expect . any ( Function ) ,
161+ } )
162+ )
163+ } )
151164 } )
152165
153166 describe ( "hooks" , ( ) => {
0 commit comments