All files / src config.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64                            113x                                                                                                  
/**
 * Configration and environment variables to enable isolated files or to
 * opt out of specific or all storybook file formats
 *
 * @module config
 */
 
/**
 * Option to make each *.stories.tsx file into a test file, whereas omitting
 * means all test files will need to be gathered as exports and executed
 * via a mount.cy.ts file which gathers all exports from these files and
 * iterates over them.
 */
export const useIsolatedComponentFiles =
  process.env.CYPRESS_USE_ISOLATED_CT_FILES;
 
/**
 * Configure the cypress storybook test runner.
 * You can put this in config object e.g.
 * ```ts
 * // in cypress.config.ts
 * export defineConfig({
 *   // ... other config
 *   component: {
 *     env: {
 *       "orphic-cypress": {
 *         format: {
 *           cyTest: false,
 *           object: false,
 *           function: true,
 *         },
 *         storyLocation: "./somewhere/",
 *       }
 *     }
 *   }
 * });
 * ```
 * or similarly in setupNodeEvents via `config.env.cyTest.format.object = false` etc.
 *
 * Provide format.cyTest to disable adding `.cyTest` format tests to stories,
 * format.object to disable `.cy = {"should x", () => ...}`, format.function to
 * disable `.cy = () => ...`. If false is provided for all three, then tests must
 * be kept in external files.
 *
 * Default is `true` for all values.
 */
export type CyTestConfig = {
  /** top level key for opting out of file formats */
  format?: {
    /** disable .cyTest format */
    cyTest?: boolean;
    /** disable .cy object format */
    object?: boolean;
    /** disable .cy function format */
    function?: boolean;
  };
  /**
   * optional to inform mount/require style tests that the root directory
   * where stories can be found is not `./src/` which is the default.
   * This lib for instance, sets it as `./stories/`
   */
  storyLocation?: string;
};