Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getScreenerSteps = (pageUrl: string, stepsModulePath: string): any[] => {
if (!fs.existsSync(`${stepsModulePath}.ts`)) {
return undefined
}
const stepsBuilder: ScreenerStepBuilder = new Steps()
const {
steps: screenerSteps,
themes = DEFAULT_THEMES,
}: ScreenerTestsConfig = require(stepsModulePath).default
_.forEach(themes, themeName => {
stepsBuilder.switchTheme(themeName).snapshot(`Theme: ${themeName}`)
_.forEach(screenerSteps, screenerStep => {
screenerStep(stepsBuilder, keys)
// We need to reload page to reset mouse position between tests
stepsBuilder.url(pageUrl).switchTheme(themeName)
})
})