diff --git a/packages/gasket-plugin-command/test/index.test.js b/packages/gasket-plugin-command/test/index.test.js index 1de7443bb..3649e78bb 100644 --- a/packages/gasket-plugin-command/test/index.test.js +++ b/packages/gasket-plugin-command/test/index.test.js @@ -26,7 +26,8 @@ describe('@gasket/plugin-command', () => { it('should have a ready hook', () => { expect(plugin.hooks.ready).toBe(ready); - expect(plugin.hooks.ready).toEqual(expect.any(Function)); + expect(plugin.hooks.ready.handler).toEqual(expect.any(Function)); + expect(plugin.hooks.ready.timing.first).toEqual(true); }); it('should have a commands hook', () => { diff --git a/packages/gasket-plugin-command/test/ready.test.js b/packages/gasket-plugin-command/test/ready.test.js index 5df3cae7c..7b9ce4c1a 100644 --- a/packages/gasket-plugin-command/test/ready.test.js +++ b/packages/gasket-plugin-command/test/ready.test.js @@ -15,7 +15,7 @@ jest.unstable_mockModule('../lib/cli.js', () => { }; }); -const ready = (await import('../lib/ready.js')).default; +const ready = ((await import('../lib/ready.js')).default).handler; describe('ready', () => { let mockGasket; diff --git a/packages/gasket-plugin-data/test/configure.test.js b/packages/gasket-plugin-data/test/configure.test.js index 04ed32797..87786850e 100644 --- a/packages/gasket-plugin-data/test/configure.test.js +++ b/packages/gasket-plugin-data/test/configure.test.js @@ -11,12 +11,10 @@ describe('configure hook', () => { beforeEach(() => { gasket = { symbol: Symbol('gasket'), - command: { - id: 'commandId' - }, config: { env: 'test', - root: 'root' + root: 'root', + command: 'commandId' } }; config = { diff --git a/packages/gasket-utils/test/config.test.js b/packages/gasket-utils/test/config.test.js index 2f6642e51..ec6168163 100644 --- a/packages/gasket-utils/test/config.test.js +++ b/packages/gasket-utils/test/config.test.js @@ -227,5 +227,26 @@ describe('applyConfigOverrides', () => { } }); }); + + it('persists commands config if commandId is undefined', () => { + mockConfig.commands = { + start: { + someService: { + url: 'https://some-dev-test.url/' + } + } + }; + + // eslint-disable-next-line no-undefined + mockContext.commandId = undefined; + results = applyConfigOverrides(mockConfig, mockContext); + expect(results).toHaveProperty('commands', { + start: { + someService: { + url: 'https://some-dev-test.url/' + } + } + }); + }) }); });