Skip to content

Commit

Permalink
test(create-plugin): add test case for overriding feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jackw committed Jul 1, 2024
1 parent b6d940e commit f879305
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/create-plugin/src/utils/tests/utils.config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('getConfig', () => {
describe('Command: Generate', () => {
beforeEach(() => {
mocks.commandName = 'generate';
mocks.argv = {};
});

it('should give back a default config', async () => {
Expand All @@ -36,6 +37,19 @@ describe('getConfig', () => {
features: DEFAULT_FEATURE_FLAGS,
});
});

it('should override default feature flags via cli args', async () => {
mocks.argv = {
useReactRouterV6: false,
bundleGrafanaUI: true,
};
const config = getConfig(tmpDir);

expect(config).toEqual({
version: getVersion(),
features: { ...DEFAULT_FEATURE_FLAGS, useReactRouterV6: false, bundleGrafanaUI: true },
});
});
});

describe('Command: Update', () => {
Expand Down

0 comments on commit f879305

Please sign in to comment.