Skip to content

Commit

Permalink
chore: add docblock
Browse files Browse the repository at this point in the history
  • Loading branch information
mammadataei committed Aug 11, 2022
1 parent c683bed commit 69ae29f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ type CypressPreprocessor = (file: FileObject) => string | Promise<string>

const cache: Record<string, string> = {}

/**
* Cypress preprocessor for running e2e tests using vite.
*
* @param {string} userConfigPath
* @example
* setupNodeEvents(on) {
* on(
* 'file:preprocessor',
* vitePreprocessor(path.resolve(__dirname, './vite.config.ts')),
* )
* },
*/
function vitePreprocessor(userConfigPath?: string): CypressPreprocessor {
if (userConfigPath) {
resolveConfig(userConfigPath)
Expand Down

0 comments on commit 69ae29f

Please sign in to comment.