@@ -66,7 +66,7 @@ test('fail-fast mode', function (t) {
6666 t . ok ( api . options . failFast ) ;
6767 t . is ( api . passCount , 1 ) ;
6868 t . is ( api . failCount , 1 ) ;
69- t . true ( / T e s t f a i l e d v i a t .f a i l ( ) / . test ( api . errors [ 0 ] . error . message ) ) ;
69+ t . match ( api . errors [ 0 ] . error . message , / T e s t f a i l e d v i a t .f a i l ( ) / ) ;
7070 } ) ;
7171} ) ;
7272
@@ -92,7 +92,7 @@ test('circular references on assertions do not break process.send', function (t)
9292 api . run ( )
9393 . then ( function ( ) {
9494 t . is ( api . failCount , 1 ) ;
95- t . true ( / ' c ' .* ?' d ' / . test ( api . errors [ 0 ] . error . message ) ) ;
95+ t . match ( api . errors [ 0 ] . error . message , / ' c ' .* ?' d ' / ) ;
9696 } ) ;
9797} ) ;
9898
@@ -114,7 +114,7 @@ test('unhandled promises will throw an error', function (t) {
114114
115115 api . on ( 'error' , function ( data ) {
116116 t . is ( data . name , 'Error' ) ;
117- t . true ( / Y o u c a n \' t h a n d l e t h i s ! / . test ( data . message ) ) ;
117+ t . match ( data . message , / Y o u c a n \' t h a n d l e t h i s ! / ) ;
118118 } ) ;
119119
120120 api . run ( )
@@ -130,7 +130,7 @@ test('uncaught exception will throw an error', function (t) {
130130
131131 api . on ( 'error' , function ( data ) {
132132 t . is ( data . name , 'Error' ) ;
133- t . true ( / C a n \' t c a t c h m e ! / . test ( data . message ) ) ;
133+ t . match ( data . message , / C a n \' t c a t c h m e ! / ) ;
134134 } ) ;
135135
136136 api . run ( )
@@ -145,7 +145,7 @@ test('stack traces for exceptions are corrected using a source map file', functi
145145 var api = new Api ( [ path . join ( __dirname , 'fixture/source-map-file.js' ) ] ) ;
146146
147147 api . on ( 'error' , function ( data ) {
148- t . true ( / T h r o w n b y s o u r c e - m a p - f i x t u r e s / . test ( data . message ) ) ;
148+ t . match ( data . message , / T h r o w n b y s o u r c e - m a p - f i x t u r e s / ) ;
149149 t . match ( data . stack , / ^ .* ?a t .* ?r u n \b .* s o u r c e - m a p - f i x t u r e s .s r c .t h r o w s .j s : 1 .* $ / m) ;
150150 t . match ( data . stack , / ^ .* ?a t \b .* s o u r c e - m a p - f i l e .j s : 1 1 .* $ / m) ;
151151 } ) ;
@@ -162,7 +162,7 @@ test('stack traces for exceptions are corrected using a source map, taking an in
162162 var api = new Api ( [ path . join ( __dirname , 'fixture/source-map-initial.js' ) ] ) ;
163163
164164 api . on ( 'error' , function ( data ) {
165- t . true ( / T h r o w n b y s o u r c e - m a p - f i x t u r e s / . test ( data . message ) ) ;
165+ t . match ( data . message , / T h r o w n b y s o u r c e - m a p - f i x t u r e s / ) ;
166166 t . match ( data . stack , / ^ .* ?a t .* ?r u n \b .* s o u r c e - m a p - f i x t u r e s .s r c .t h r o w s .j s : 1 .* $ / m) ;
167167 t . match ( data . stack , / ^ .* ?a t \b .* s o u r c e - m a p - i n i t i a l - i n p u t .j s : 7 .* $ / m) ;
168168 } ) ;
@@ -191,9 +191,9 @@ test('titles of both passing and failing tests and AssertionErrors are returned'
191191
192192 api . run ( )
193193 . then ( function ( ) {
194- t . true ( / t h i s i s a f a i l i n g t e s t / . test ( api . errors [ 0 ] . title ) ) ;
195- t . true ( / t h i s i s a p a s s i n g t e s t / . test ( api . tests [ 0 ] . title ) ) ;
196- t . true ( / A s s e r t i o n E r r o r / . test ( api . errors [ 0 ] . error . name ) ) ;
194+ t . match ( api . errors [ 0 ] . title , / t h i s i s a f a i l i n g t e s t / ) ;
195+ t . match ( api . tests [ 0 ] . title , / t h i s i s a p a s s i n g t e s t / ) ;
196+ t . match ( api . errors [ 0 ] . error . name , / A s s e r t i o n E r r o r / ) ;
197197 } ) ;
198198} ) ;
199199
@@ -205,7 +205,7 @@ test('empty test files creates a failure with a helpful warning', function (t) {
205205 api . run ( )
206206 . catch ( function ( err ) {
207207 t . ok ( err ) ;
208- t . true ( / N o t e s t s f o u n d .* ?i m p o r t " a v a " / . test ( err . message ) ) ;
208+ t . match ( err . message , / N o t e s t s f o u n d .* ?i m p o r t " a v a " / ) ;
209209 } ) ;
210210} ) ;
211211
@@ -217,7 +217,7 @@ test('test file with no tests creates a failure with a helpful warning', functio
217217 api . run ( )
218218 . catch ( function ( err ) {
219219 t . ok ( err ) ;
220- t . true ( / N o t e s t s / . test ( err . message ) ) ;
220+ t . match ( err . message , / N o t e s t s / ) ;
221221 } ) ;
222222} ) ;
223223
@@ -229,7 +229,7 @@ test('test file that immediately exits with 0 exit code ', function (t) {
229229 api . run ( )
230230 . catch ( function ( err ) {
231231 t . ok ( err ) ;
232- t . true ( / T e s t r e s u l t s w e r e n o t r e c e i v e d f r o m / . test ( err . message ) ) ;
232+ t . match ( err . message , / T e s t r e s u l t s w e r e n o t r e c e i v e d f r o m / ) ;
233233 } ) ;
234234} ) ;
235235
@@ -253,7 +253,7 @@ test('test file in node_modules is ignored', function (t) {
253253 api . run ( )
254254 . catch ( function ( err ) {
255255 t . ok ( err ) ;
256- t . true ( / C o u l d n ' t f i n d a n y f i l e s t o t e s t / . test ( err . message ) ) ;
256+ t . match ( err . message , / C o u l d n ' t f i n d a n y f i l e s t o t e s t / ) ;
257257 } ) ;
258258} ) ;
259259
0 commit comments