Skip to content

Commit fa9d1a3

Browse files
committed
test: add test
1 parent 6a55962 commit fa9d1a3

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

test/commands/app/deploy.test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ beforeEach(() => {
176176
helpers.buildExcShellViewExtensionMetadata.mockReset()
177177
helpers.createWebExportFilter.mockReset()
178178
helpers.rewriteActionUrlInEntities.mockReset()
179+
mockConfig.reload.mockReset()
179180
mockLogForwarding.isLocalConfigChanged.mockReset()
180181
mockLogForwarding.getLocalConfigWithSecrets.mockReset()
181182
mockLogForwarding.updateServerConfig.mockReset()
@@ -868,6 +869,24 @@ describe('run', () => {
868869
expect(command.error).toHaveBeenCalledTimes(0)
869870
})
870871

872+
test('deploy reloads config before deploying actions', async () => {
873+
command.getAppExtConfigs.mockResolvedValueOnce(createAppConfig(command.appConfig))
874+
const noScriptFound = undefined
875+
helpers.runInProcess
876+
.mockResolvedValueOnce(noScriptFound) // pre-app-deploy
877+
.mockResolvedValueOnce(noScriptFound) // deploy-actions
878+
.mockResolvedValueOnce(noScriptFound) // post-app-deploy
879+
880+
command.argv = ['--no-web-assets']
881+
await command.run()
882+
883+
expect(mockConfig.reload).toHaveBeenCalledTimes(1)
884+
expect(mockRuntimeLib.deployActions).toHaveBeenCalledTimes(1)
885+
expect(mockConfig.reload.mock.invocationCallOrder[0]).toBeLessThan(
886+
mockRuntimeLib.deployActions.mock.invocationCallOrder[0]
887+
)
888+
})
889+
871890
test('deploy (has deploy-actions and deploy-static hooks)', async () => {
872891
command.getAppExtConfigs.mockResolvedValueOnce(createAppConfig(command.appConfig))
873892
const noScriptFound = undefined

0 commit comments

Comments
 (0)