-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(models): add default value for outputDir (#358)
- Loading branch information
Showing
36 changed files
with
341 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/cli/src/lib/implementation/core-config-options.integration.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { describe, expect } from 'vitest'; | ||
import { CoreConfig } from '@code-pushup/models'; | ||
import { objectToCliArgs } from '@code-pushup/utils'; | ||
import { yargsCli } from '../yargs-cli'; | ||
import { yargsCoreConfigOptionsDefinition } from './core-config-options'; | ||
|
||
describe('configOptions', () => { | ||
function cli(args: Record<string, unknown>): Promise<CoreConfig> { | ||
return yargsCli(objectToCliArgs(args), { | ||
options: yargsCoreConfigOptionsDefinition(), | ||
}).parseAsync() as unknown as Promise<CoreConfig>; | ||
} | ||
|
||
it('should fill defaults', async () => { | ||
const config = await cli({}); | ||
expect(config).toBeDefined(); | ||
// only _ and $0 | ||
expect(Object.keys(config)).toHaveLength(2); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/cli/src/lib/implementation/global-options.integration.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { describe, expect } from 'vitest'; | ||
import { objectToCliArgs } from '@code-pushup/utils'; | ||
import { yargsCli } from '../yargs-cli'; | ||
import { yargsGlobalOptionsDefinition } from './global-options'; | ||
import { GeneralCliOptions } from './model'; | ||
|
||
describe('globalOptions', () => { | ||
function cli(args: Record<string, unknown>): Promise<GeneralCliOptions> { | ||
return yargsCli(objectToCliArgs(args), { | ||
options: yargsGlobalOptionsDefinition(), | ||
}).parseAsync() as unknown as Promise<GeneralCliOptions>; | ||
} | ||
|
||
it('should fill defaults', async () => { | ||
const config = await cli({}); | ||
expect(config.verbose).toBe(false); | ||
expect(config.progress).toBe(true); | ||
expect(config.config).toBe('code-pushup.config.js'); | ||
}); | ||
}); |
8 changes: 6 additions & 2 deletions
8
packages/cli/src/lib/print-config/print-config-command.unit.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.