@@ -3,7 +3,7 @@ import {promises as fs} from 'fs';
3
3
import { dump , load as loadYaml } from 'js-yaml' ;
4
4
import { fileTypes } from '@form8ion/core' ;
5
5
// eslint-disable-next-line import/no-extraneous-dependencies,import/no-unresolved
6
- import { load , write } from '@form8ion/config-file' ;
6
+ import { load , write , exists } from '@form8ion/config-file' ;
7
7
8
8
import { After , Before , Given , Then , When } from '@cucumber/cucumber' ;
9
9
import stubbedFs from 'mock-fs' ;
@@ -87,6 +87,10 @@ When('the provided config is merged into the existing file', async function () {
87
87
return 'pending' ;
88
88
} ) ;
89
89
90
+ When ( 'checking for config existence' , async function ( ) {
91
+ this . configExists = await exists ( { name : this . configName } ) ;
92
+ } ) ;
93
+
90
94
Then ( 'the config is defined in the file' , async function ( ) {
91
95
const { desiredConfigFileFormat} = this ;
92
96
const fileContents = await fs . readFile (
@@ -113,3 +117,11 @@ Then('a missing-config error is thrown', async function () {
113
117
assert . equal ( message , 'No configuration found' ) ;
114
118
assert . equal ( code , 'ENOCONFIG' ) ;
115
119
} ) ;
120
+
121
+ Then ( 'the config is reported to not be found' , async function ( ) {
122
+ assert . equal ( this . configExists , false ) ;
123
+ } ) ;
124
+
125
+ Then ( 'the config is reported to be found' , async function ( ) {
126
+ assert . equal ( this . configExists , true ) ;
127
+ } ) ;
0 commit comments