11import { getConfig , getTestRoot } from './utils.js' ;
22import Config from '../config.js' ;
33import Codecept from '../codecept.js' ;
4- import * as output from '../output.js' ;
4+ import { output } from '../output.js' ;
55import * as event from '../event.js' ;
66import { store } from '../store.js' ;
7- import Container from '../container.js' ;
7+ import container from '../container.js' ;
8+ import colors from "chalk" ;
9+ import figures from "figures" ;
810
911export default async function ( test , options ) {
1012 if ( options . grep ) process . env . grep = options . grep . toLowerCase ( ) ;
@@ -47,13 +49,10 @@ export default async function (test, options) {
4749}
4850
4951function printTests ( files ) {
50- const figures = require ( 'figures' ) ;
51- const colors = require ( 'chalk' ) ;
52-
53- output . print ( output . output . styles . debug ( `Tests from ${ global . codecept_dir } :` ) ) ;
52+ output . print ( output . styles . debug ( `Tests from ${ global . codecept_dir } :` ) ) ;
5453 output . print ( ) ;
5554
56- const mocha = Container . mocha ( ) ;
55+ const mocha = container . mocha ( ) ;
5756 mocha . files = files ;
5857 mocha . loadFiles ( ) ;
5958
@@ -70,7 +69,7 @@ function printTests(files) {
7069 numOfSuites ++ ;
7170 }
7271
73- for ( test of suite . tests ) {
72+ for ( const test of suite . tests ) {
7473 if ( test . title . toLowerCase ( ) . includes ( filterBy ) ) {
7574 numOfTests ++ ;
7675 outputString += `${ colors . white . bold ( test . parent . title ) } -- ${ output . styles . log ( test . parent . file || '' ) } -- ${ mocha . suite . suites . length } tests\n` ;
@@ -84,7 +83,7 @@ function printTests(files) {
8483 output . print ( `${ colors . white . bold ( suite . title ) } -- ${ output . styles . log ( suite . file || '' ) } -- ${ mocha . suite . suites . length } tests` ) ;
8584 numOfSuites ++ ;
8685
87- for ( test of suite . tests ) {
86+ for ( const test of suite . tests ) {
8887 numOfTests ++ ;
8988 output . print ( ` ${ output . styles . scenario ( figures . checkboxOff ) } ${ test . title } ` ) ;
9089 }
0 commit comments