1- 'use strict'
1+ import readline from 'readline'
2+ import { state } from './state.js'
3+ import { char , color , fmtMs , plural } from './utility.js'
24
3- const readline = require ( 'readline' )
4- const { state } = require ( './state' )
5- const { char, color, fmtMs, plural } = require ( './utility' )
6-
7- const writeNonVerboseCount = ( ) => {
5+ export const writeNonVerboseCount = ( ) => {
86 const count = ++ state . fileTestCount
97 readline . cursorTo ( process . stdout , 0 )
108 readline . moveCursor ( process . stdout , 0 , - 2 )
119 process . stdout . write ( `\n${ char ( 'good' ) } ${ count } tests passed\n` )
1210}
1311
14- const info = ( msg ) => process . stdout . write ( msg )
12+ export const info = ( msg ) => process . stdout . write ( msg )
1513
16- const reporter = ( { msg, pass, out, error, mod } ) => {
14+ export const reporter = ( { msg, pass, out, error, mod } ) => {
1715 const skipNonVerbose = { skip : true , todo : true }
1816 if ( out ) {
1917 if ( state . verbose ) {
@@ -24,7 +22,7 @@ const reporter = ({ msg, pass, out, error, mod }) => {
2422 }
2523}
2624
27- const summary = ( ms ) => {
25+ export const summary = ( ms ) => {
2826 const counts = state . counts
2927 const result = `${ color . green } All tests passed in ${ fmtMs ( ms ) } ${ color . reset } `
3028 process . stdout . write ( `\n${ char ( 'good' ) } ${ result } \n` )
@@ -52,5 +50,3 @@ const summary = (ms) => {
5250 }
5351 }
5452}
55-
56- module . exports = { reporter, writeNonVerboseCount, info, summary }
0 commit comments