Skip to content

Commit

Permalink
Tune tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmason2-godaddy authored and agerard-godaddy committed Dec 11, 2024
1 parent 90a7c2d commit 9560fb3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
3 changes: 2 additions & 1 deletion packages/gasket-plugin-command/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/gasket-plugin-command/test/ready.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions packages/gasket-plugin-data/test/configure.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
21 changes: 21 additions & 0 deletions packages/gasket-utils/test/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
}
}
});
})
});
});

0 comments on commit 9560fb3

Please sign in to comment.