File tree Expand file tree Collapse file tree 2 files changed +19
-16
lines changed
Expand file tree Collapse file tree 2 files changed +19
-16
lines changed Original file line number Diff line number Diff line change 1- const util = require ( 'util' )
2- const path = require ( 'path' )
3- const fs = require ( 'fs' )
4- const axios = require ( 'axios' ) . default
5- const exec = util . promisify ( require ( 'child_process' ) . exec )
6- const { clearString, deepMerge } = require ( '../utils' )
7- const { container, event, recorder, output } = require ( '../index' )
1+ import util from 'util'
2+ import path from 'path'
3+ import fs from 'fs'
4+ import axios from 'axios'
5+ import { exec as execCallback } from 'child_process'
6+ const exec = util . promisify ( execCallback )
7+ import { clearString , deepMerge } from '../utils.js'
8+ import { container , event , recorder , output } from '../index.js'
89
910const defaultBrowserConfig = {
1011 chrome : {
@@ -252,7 +253,7 @@ const selenoid = config => {
252253 }
253254}
254255
255- module . exports = selenoid
256+ export default selenoid
256257
257258function videoSaved ( test ) {
258259 const fileName = `${ clearString ( test . title ) } .mp4`
Original file line number Diff line number Diff line change 1- const debug = require ( 'debug' ) ( 'codeceptjs:plugin:wdio' )
1+ import debugModule from 'debug'
2+ const debug = debugModule ( 'codeceptjs:plugin:wdio' )
23
3- const container = require ( '../container' )
4- const mainConfig = require ( '../config' )
5- const recorder = require ( '../recorder' )
6- const event = require ( '../event' )
7- const output = require ( '../output' )
4+ import container from '../container.js'
5+ import mainConfig from '../config.js'
6+ import recorder from '../recorder.js'
7+ import event from '../event.js'
8+ import output from '../output.js'
89
910const defaultConfig = {
1011 services : [ ] ,
1112 capabilities : { } ,
1213}
1314
15+
1416let restartsSession
1517
1618/**
@@ -81,7 +83,7 @@ let restartsSession
8183 * * ... - additional configuration passed into services.
8284 *
8385 */
84- module . exports = config => {
86+ export default config => {
8587 // Keep initial configs to pass as options to wdio services
8688 const wdioOptions = { ...config }
8789 const webDriver = container . helpers ( 'WebDriver' )
@@ -237,7 +239,7 @@ module.exports = config => {
237239
238240function safeRequire ( name ) {
239241 try {
240- return require ( name )
242+ return import ( name )
241243 } catch ( e ) {
242244 if ( ! e . message . match ( `Cannot find module '${ name } '` ) ) {
243245 throw new Error ( `Couldn't initialise "${ name } ".\n${ e . stack } ` )
You can’t perform that action at this time.
0 commit comments