mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Allow for custom CLI and variable options
* feat: (AppRunner) Mechanism to configure cli args and derive componentsjs vars from them implemented * fix: (AppRunner) tidying * fix: (AppRunner) tidying up * fix: (AppRunner) runCli method made sync * fix; (VarResolver) refactored to multiple files, and other stylistic fixes. * chore: (AppRunner) Uses builder pattern for yargs base arguments setup to enable better typescript inference * fix(AppRunner): refactoring AppRunner and VarResolver * fix(AppRunner): refactoring AppRunner promise handling * fix(AppRunner): verror dependency removal * fix: Simplify CLI error handling * feat: Use same config for both CLI and app instantiation * fix: Update typings and imports * feat: Split VariableResolver behaviour to 2 classes * feat: Move default value behaviour from CLI to ValueComputers * test: Add unit tests for new CLI classes * feat: Integrate new CLI configuration with all default configurations * feat: Add createApp function to AppRunner * docs: Update comments in CLI-related classes * fix: Various fixes and refactors Co-authored-by: damooo <damodara@protonmail.com>
This commit is contained in:
committed by
GitHub
parent
d067165b68
commit
c216efd62f
13
test/unit/init/CliResolver.test.ts
Normal file
13
test/unit/init/CliResolver.test.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { CliExtractor } from '../../../src/init/cli/CliExtractor';
|
||||
import { CliResolver } from '../../../src/init/CliResolver';
|
||||
import type { SettingsResolver } from '../../../src/init/variables/SettingsResolver';
|
||||
|
||||
describe('A CliResolver', (): void => {
|
||||
it('stores a CliExtractor and SettingsResolver.', async(): Promise<void> => {
|
||||
const cliExtractor: CliExtractor = { canHandle: jest.fn().mockResolvedValue('CLI!') } as any;
|
||||
const settingsResolver: SettingsResolver = { canHandle: jest.fn().mockResolvedValue('Settings!') } as any;
|
||||
const cliResolver = new CliResolver(cliExtractor, settingsResolver);
|
||||
expect(cliResolver.cliExtractor).toBe(cliExtractor);
|
||||
expect(cliResolver.settingsResolver).toBe(settingsResolver);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user