MCPcopy
hub / github.com/ionic-team/ionic-framework / configs

Function configs

core/src/utils/test/playwright/generator.ts:79–107  ·  view source on GitHub ↗
(testConfig: TestConfigOption = DEFAULT_TEST_CONFIG_OPTION)

Source from the content-addressed store, hash-verified

77 * Given a config generate an array of test variants.
78 */
79export const configs = (testConfig: TestConfigOption = DEFAULT_TEST_CONFIG_OPTION): TestUtilities[] => {
80 const { modes, directions } = testConfig;
81
82 const configs: TestConfig[] = [];
83
84 /**
85 * If certain options are not provided,
86 * fall back to the defaults.
87 */
88 const processedMode = modes ?? DEFAULT_MODES;
89 const processedDirection = directions ?? DEFAULT_DIRECTIONS;
90 const processedPalette = testConfig.palettes ?? DEFAULT_PALETTES;
91
92 processedMode.forEach((mode) => {
93 processedDirection.forEach((direction) => {
94 processedPalette.forEach((palette) => {
95 configs.push({ mode, direction, palette });
96 });
97 });
98 });
99
100 return configs.map((config) => {
101 return {
102 config,
103 title: (title: string) => generateTitle(title, config),
104 screenshot: (fileName: string) => generateScreenshotName(fileName, config),
105 };
106 });
107};
108
109const DEFAULT_MODES: Mode[] = ['ios', 'md'];
110const DEFAULT_DIRECTIONS: Direction[] = ['ltr', 'rtl'];

Calls 3

generateTitleFunction · 0.85
generateScreenshotNameFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected