@@ -247,15 +247,15 @@ describe('Document', () => {
247247 const textDocument = TextDocument . create ( 'file:///test.json' , 'json' , 1 , content ) ;
248248 const doc = new Document ( textDocument ) ;
249249
250- expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Unknown ) ;
250+ expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Other ) ;
251251 } ) ;
252252
253253 it ( 'package.json with CloudFormation-like keys' , ( ) => {
254254 const content = '{"name": "my-package", "Parameters": {"env": "prod"}, "Outputs": {"build": "dist"}}' ;
255255 const textDocument = TextDocument . create ( 'file:///test.json' , 'json' , 1 , content ) ;
256256 const doc = new Document ( textDocument ) ;
257257
258- expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Unknown ) ;
258+ expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Other ) ;
259259 } ) ;
260260
261261 it ( 'nested Resources key' , ( ) => {
@@ -270,25 +270,33 @@ describe('Document', () => {
270270 const textDocument = TextDocument . create ( 'file:///test.json' , 'json' , 1 , content ) ;
271271 const doc = new Document ( textDocument ) ;
272272
273- expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Unknown ) ;
273+ expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Other ) ;
274274 } ) ;
275275 } ) ;
276276
277277 describe ( 'should handle empty content' , ( ) => {
278- it ( 'empty file should be Unknown ' , ( ) => {
278+ it ( 'empty file should be Empy ' , ( ) => {
279279 const content = '' ;
280280 const textDocument = TextDocument . create ( 'file:///test.json' , 'json' , 1 , content ) ;
281281 const doc = new Document ( textDocument ) ;
282282
283- expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Unknown ) ;
283+ expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Empty ) ;
284284 } ) ;
285285
286- it ( 'whitespace-only file should be Unknown ' , ( ) => {
286+ it ( 'whitespace-only file should be Empy ' , ( ) => {
287287 const content = ' \n\n \t ' ;
288288 const textDocument = TextDocument . create ( 'file:///test.yaml' , 'yaml' , 1 , content ) ;
289289 const doc = new Document ( textDocument ) ;
290290
291- expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Unknown ) ;
291+ expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Empty ) ;
292+ } ) ;
293+
294+ it ( 'string only should be Empty' , ( ) => {
295+ const content = '\nRe\n' ;
296+ const textDocument = TextDocument . create ( 'file:///test.yaml' , 'yaml' , 1 , content ) ;
297+ const doc = new Document ( textDocument ) ;
298+
299+ expect ( doc . cfnFileType ) . toBe ( CloudFormationFileType . Empty ) ;
292300 } ) ;
293301 } ) ;
294302
0 commit comments