From 6f07141b0d3b83f0601061ee90c62c8bab6eaff9 Mon Sep 17 00:00:00 2001 From: hacksalot Date: Mon, 5 Feb 2018 00:06:14 -0500 Subject: [PATCH] test: remove image files from freeze test --- test/scripts/test-themes.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/scripts/test-themes.js b/test/scripts/test-themes.js index 6d42f23..3c68ada 100644 --- a/test/scripts/test-themes.js +++ b/test/scripts/test-themes.js @@ -93,13 +93,17 @@ function genThemes( title, src, fmt ) { } function folderContains( needle, haystack ) { + var ignoreExts = ['.png','.jpg','.jpeg','.bmp','.pdf', '.gif']; var safePath = path.normalize( path.join(__dirname, haystack)); return _.some( readFolder( safePath ), function( absPath ) { if( require('fs').lstatSync( absPath ).isFile() ) { - if( fileContains( absPath, needle ) ) { + var pathInfo = path.parse( absPath ); + if( !_.contains(ignoreExts, pathInfo.ext) && + fileContains(absPath, needle) ) { console.error('Found invalid metadata in ' + absPath); return true; } + return false; } }); }