@component-controls/cc-cli v4.0.3
Table of contents
Overview
- Easy to use cli with "zero" configuration.
- Generates test files in cjs, esm or typescript format.
- More advanced level to customize the framework renderer.
- Advanced level for full control over which stories to use for the tests.
Install
yarn add @component-controls/cc-cli --devAPI
createStoreTemplate
function
create one large dynamic test for all the stories in the configuration/bundle
defined in @component-controls/cc-cli/plugins/cc-cli/src/jest-templates/store-template.ts
parameters
| Name | Type | Description |
|---|---|---|
options* | P | rendering options |
dataImports | DataImportOptionsfilePath*: stringdata*: Record<string, any> | |
configuration | typewebpack: Configuration | WebpackConfigFnfinalWebpack: Configuration | WebpackConfigFnpresets: RuleType[]configPath: stringdistFolder: stringbundleName: stringstaticFolder: stringcssFileName: stringlogOptions: Partial<LogOptions>mode: "none" | "development" | "production"loadersencodeHTML*: encodeHTMLat*: function (index*: number) => T | undefinedmodule: stringident: stringloader: stringoptions: string | typestories: string | string[]files: string | string[]siteRoot: stringignore: string[]pages[string]: categories: DocType[]siteMap: type | booleansiteUrl: stringinstrument: anysearchindexingModule: stringsearchingModule*: stringfields: SearchFields[]emptySearchDocuments: string[]hitsPerPage: numberoptions: anytokensfigmaAccessToken: stringgithubAccessToken: stringcomponent: string | Record<string, unknown> | ElementType<Props>subcomponents: Record<string, (string, Record<string, unknown>, ElementType<Props>)>controls[string]: ComponentControlText | ComponentControlBoolean | ComponentControlColor | ComponentControlDate | ComponentControlObject<> | ComponentControlButton<> | ComponentControlOptions<> | ComponentControlNumber | ComponentControlArray | ComponentControlFilessmartControlssmart: booleaninclude: string[] | IncludeFnexclude: string[] | IncludeFndecorators: StoryRenderFn[]plugins: anycategory: string | |
returns | Promise<string> | a string with the rendered template |
createStoriesTemplate
function
create tests on a stories base (a test file for each document and inside, a test for each story)
defined in @component-controls/cc-cli/plugins/cc-cli/src/jest-templates/stories-template.ts
parameters
| Name | Type | Description |
|---|---|---|
options* | P | rendering options |
dataImports | DataImportOptionsfilePath*: stringdata*: Record<string, any> | |
configuration | BuildConfigurationwebpack: Configuration | WebpackConfigFnfinalWebpack: Configuration | WebpackConfigFnpresets: RuleType[]configPath: stringdistFolder: stringbundleName: stringstaticFolder: stringcssFileName: stringlogOptions: Partial<LogOptions>mode: "none" | "development" | "production"loadersencodeHTML*: encodeHTMLat*: function (index*: ) => T | undefinedmodule: stringstories: string | string[]files: string | string[]siteRoot: stringignore: string[]pages[string]: categories: DocType[]siteMap: type | booleansiteUrl: stringinstrument: anysearchindexingModule: stringsearchingModule*: stringfields: SearchFields[]emptySearchDocuments: string[]hitsPerPage: numberoptions: anytokensfigmaAccessToken: stringgithubAccessToken: stringcomponent: string | Record<string, unknown> | ElementType<Props>subcomponents: Record<string, (string, Record<string, unknown>, ElementType<Props>)>controls[string]: ComponentControlText | ComponentControlBoolean | ComponentControlColor | ComponentControlDate | ComponentControlObject<P> | ComponentControlButton | ComponentControlOptions | ComponentControlNumber | ComponentControlArray | ComponentControlFilessmartControlssmart: booleaninclude: string[] | IncludeFnexclude: string[] | IncludeFndecorators: StoryRenderFn[]plugins: anycategory: string | global configuration used at build time stored in a file named main.js/main.ts |
returns | Promise<string> | a string with the rendered template |
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago