@@ -159,7 +159,7 @@ describe('The validator', () => {
159159 expect ( validator . _settings . trailingspaces ) . toBeFalsy ( ) ;
160160 expect ( validator . _settings . newline ) . toBeFalsy ( ) ;
161161 expect ( validator . _settings . indentation ) . toBe ( 'tabs' ) ;
162- expect ( validator . _settings . spaces ) . toBe ( 'tab' ) ;
162+ expect ( validator . _settings . spaces ) . toBe ( false ) ;
163163 expect ( validator . _settings . endOfLine ) . toBe ( 'lf' ) ;
164164
165165 // Unchanged:
@@ -210,11 +210,61 @@ describe('The validator', () => {
210210
211211 // test for expected properties by editorconfig:
212212 expect ( validator . _settings . indentation ) . toBe ( 'tabs' ) ;
213- expect ( validator . _settings . spaces ) . toBe ( 'tab' ) ;
213+ expect ( validator . _settings . spaces ) . toBe ( false ) ;
214214 expect ( validator . _settings . trailingspaces ) . toBeTruthy ( ) ;
215215 expect ( validator . _settings . newline ) . toBeTruthy ( ) ;
216216 } ) ;
217217
218+ it ( 'should parse "unset" value as false' , ( ) => {
219+ // fake loading:
220+ const validator = new Validator ( {
221+ editorconfig : __fromFixtures ( '.editorconfig.unset' ) ,
222+
223+ trailingspaces : true ,
224+ newline : true ,
225+
226+ indentation : 'spaces' ,
227+ spaces : 2 ,
228+ endOfLine : true ,
229+ } ) ;
230+
231+ // Load editorconfig with extension where options are disabled:
232+ validator . _path = __fromFixtures ( 'core.fixture' ) ;
233+ validator . _loadSettings ( ) ;
234+ expect ( validator . _settings ) . toEqual ( expect . objectContaining ( {
235+ trailingspaces : false ,
236+ newline : false ,
237+ indentation : false ,
238+ spaces : false ,
239+ endOfLine : false ,
240+ } ) )
241+ } ) ;
242+
243+ it ( 'should parse invalid value as false' , ( ) => {
244+ // fake loading:
245+ const validator = new Validator ( {
246+ editorconfig : __fromFixtures ( '.editorconfig.invalid' ) ,
247+
248+ trailingspaces : true ,
249+ newline : true ,
250+
251+ indentation : 'spaces' ,
252+ spaces : 2 ,
253+ endOfLine : true ,
254+ } ) ;
255+
256+ // Load editorconfig with extension where options are disabled:
257+ validator . _path = __fromFixtures ( 'core.fixture' ) ;
258+ validator . _loadSettings ( ) ;
259+ expect ( validator . _settings ) . toEqual ( expect . objectContaining ( {
260+ trailingspaces : false ,
261+ newline : false ,
262+ indentation : false ,
263+ spaces : false ,
264+ endOfLine : false ,
265+ } ) )
266+ } ) ;
267+
218268 it ( 'should throw if is not a file' , ( ) => {
219269 const file = __fromFixtures ( 'core.fixture' ) ;
220270 [
0 commit comments