File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed
Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 11export { default as scaffold } from './scaffolder.js' ;
2+ export { default as test } from './tester.js' ;
23export { default as remove } from './remover.js' ;
Original file line number Diff line number Diff line change 1+ import { assert } from 'chai' ;
2+
3+ import any from '@travi/any' ;
4+ import * as td from 'testdouble' ;
5+
6+ suite ( 'mocha predicate' , ( ) => {
7+ let checkForMocha , core ;
8+ const projectRoot = any . string ( ) ;
9+
10+ setup ( async ( ) => {
11+ core = await td . replaceEsm ( '@form8ion/core' ) ;
12+
13+ ( { default : checkForMocha } = ( await import ( './tester.js' ) ) ) ;
14+ } ) ;
15+
16+ teardown ( ( ) => td . reset ( ) ) ;
17+
18+ test ( 'that `false` is returned if no evidence of mocha is detected' , async ( ) => {
19+ td . when ( core . fileExists ( `${ projectRoot } /.mocharc.json` ) ) . thenResolve ( false ) ;
20+
21+ assert . isFalse ( await checkForMocha ( { projectRoot} ) ) ;
22+ } ) ;
23+
24+ test ( 'that `true` is returned if the `.mocharc.json` file is found in the project' , async ( ) => {
25+ td . when ( core . fileExists ( `${ projectRoot } /.mocharc.json` ) ) . thenResolve ( true ) ;
26+
27+ assert . isTrue ( await checkForMocha ( { projectRoot} ) ) ;
28+ } ) ;
29+ } ) ;
Original file line number Diff line number Diff line change 1+ import { fileExists } from '@form8ion/core' ;
2+
3+ export default function ( { projectRoot} ) {
4+ return fileExists ( `${ projectRoot } /.mocharc.json` ) ;
5+ }
You can’t perform that action at this time.
0 commit comments