@@ -365,7 +365,7 @@ describe('mocha', function() {
365365
366366 function cleanup ( ) {
367367 var run = require ( '../../bin/run-clean' ) ;
368- run ( [ 'node' , 'bin/run-clean' , 'test/mocha.opts ' ] ) ;
368+ run ( [ 'node' , 'bin/run-clean' , '.mocharc.json ' ] ) ;
369369 }
370370
371371 beforeEach ( ( ) => {
@@ -378,42 +378,50 @@ describe('mocha', function() {
378378 process . chdir ( cwd ) ;
379379 } ) ;
380380
381- it ( 'loads built-in mocha.opts file' , ( ) => {
381+ it ( 'loads built-in .mocharc.json file' , ( ) => {
382382 var run = require ( '../../bin/run-mocha' ) ;
383383 var command = run ( [ 'node' , 'bin/run-mocha' , '"dist/__tests__"' ] , true ) ;
384384 const builtInMochaOptsFile = path . join (
385385 __dirname ,
386- '../../config/mocha.opts ' ,
386+ '../../config/.mocharc.json ' ,
387387 ) ;
388388 assert (
389389 command . indexOf ( builtInMochaOptsFile ) !== - 1 ,
390- '--opts should be set by default' ,
390+ '--config should be set by default' ,
391391 ) ;
392392 } ) ;
393393
394- it ( 'honors --opts option' , ( ) => {
394+ it ( 'honors --config option' , ( ) => {
395395 var run = require ( '../../bin/run-mocha' ) ;
396396 var command = run (
397- [ 'node' , 'bin/run-mocha' , '--opts custom/mocha.opts' , '"dist/__tests__"' ] ,
397+ [
398+ 'node' ,
399+ 'bin/run-mocha' ,
400+ '--config custom/.mocharc.json' ,
401+ '"dist/__tests__"' ,
402+ ] ,
398403 true ,
399404 ) ;
400405 assert (
401- command . indexOf ( '--opts custom/mocha.opts ' ) !== - 1 ,
402- '--opts custom/mocha.opts should be honored' ,
406+ command . indexOf ( '--config custom/.mocharc.json ' ) !== - 1 ,
407+ '--config custom/.mocharc.json should be honored' ,
403408 ) ;
404409 } ) ;
405410
406- it ( 'loads mocha.opts specific project file' , ( ) => {
411+ it ( 'loads .mocharc.json specific project file' , ( ) => {
407412 var run = require ( '../../bin/run-mocha' ) ;
408- const buitInMochaOptsPath = path . join ( __dirname , '../../config/mocha.opts' ) ;
409- const destPath = path . join ( __dirname , './fixtures/test/mocha.opts' ) ;
413+ const buitInMochaOptsPath = path . join (
414+ __dirname ,
415+ '../../config/.mocharc.json' ,
416+ ) ;
417+ const destPath = path . join ( __dirname , './fixtures/.mocharc.json' ) ;
410418
411419 fs . copyFileSync ( buitInMochaOptsPath , destPath ) ;
412420
413421 var command = run ( [ 'node' , 'bin/run-mocha' , '"dist/__tests__"' ] , true ) ;
414422 assert (
415- command . indexOf ( '--opts ' ) === - 1 ,
416- 'should skip built-in mocha.opts file when specific project file exist' ,
423+ command . indexOf ( '--config ' ) === - 1 ,
424+ 'should skip built-in .mocharc.json file when specific project file exist' ,
417425 ) ;
418426 } ) ;
419427} ) ;
0 commit comments