run the hooks only in support

This commit is contained in:
ElevateBart
2021-02-11 15:14:46 -06:00
parent a524e95a8b
commit 939e4c5942
3 changed files with 3 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
export * from './mount'
export * from './mountHook'
export * from './hooks'

View File

@@ -2,15 +2,12 @@ import * as React from 'react'
import ReactDOM, { unmountComponentAtNode } from 'react-dom'
import getDisplayName from './getDisplayName'
import { injectStylesBeforeElement } from './utils'
import { setupHooks } from './hooks'
// @ts-ignore
export * from 'cypress-react-selector'
const rootId = 'cypress-root'
setupHooks()
/**
* Inject custom style text or CSS file or 3rd party style resources
*/

View File

@@ -1,6 +1,6 @@
// should be loaded from cypress.json as a support file
// "supportFile": "node_modules/@cypress/react/support"
// adds commands from @cypress/react
require('../dist/hooks').setupHooks()
require('../dist').setupHooks()
require('cypress-react-selector')
require('@cypress/code-coverage/support')