@@ -42,7 +42,7 @@ describe('Importer', function () {
4242
4343 it ( 'gets the correct extensions' , function ( ) {
4444 assert ( Array . isArray ( ImportManager . getExtensions ( ) ) ) ;
45- assert . equal ( ImportManager . getExtensions ( ) . length , 32 ) ;
45+ assert . equal ( ImportManager . getExtensions ( ) . length , 54 ) ;
4646 assert ( ImportManager . getExtensions ( ) . includes ( '.csv' ) ) ;
4747 assert ( ImportManager . getExtensions ( ) . includes ( '.json' ) ) ;
4848 assert ( ImportManager . getExtensions ( ) . includes ( '.zip' ) ) ;
@@ -57,23 +57,20 @@ describe('Importer', function () {
5757 assert ( ImportManager . getExtensions ( ) . includes ( '.m4a' ) ) ;
5858
5959 assert ( ImportManager . getExtensions ( ) . includes ( '.pdf' ) ) ;
60- assert ( ImportManager . getExtensions ( ) . includes ( '.json' ) ) ;
61- assert ( ImportManager . getExtensions ( ) . includes ( '.jsonld' ) ) ;
62- assert ( ImportManager . getExtensions ( ) . includes ( '.odp' ) ) ;
63- assert ( ImportManager . getExtensions ( ) . includes ( '.ods' ) ) ;
64- assert ( ImportManager . getExtensions ( ) . includes ( '.odt' ) ) ;
65- assert ( ImportManager . getExtensions ( ) . includes ( '.ppt' ) ) ;
6660 assert ( ImportManager . getExtensions ( ) . includes ( '.pptx' ) ) ;
67- assert ( ImportManager . getExtensions ( ) . includes ( '.rtf' ) ) ;
6861 assert ( ImportManager . getExtensions ( ) . includes ( '.txt' ) ) ;
69- assert ( ImportManager . getExtensions ( ) . includes ( '.xls' ) ) ;
7062 assert ( ImportManager . getExtensions ( ) . includes ( '.xlsx' ) ) ;
7163 assert ( ImportManager . getExtensions ( ) . includes ( '.xml' ) ) ;
64+ assert ( ImportManager . getExtensions ( ) . includes ( '.docx' ) ) ;
65+ assert ( ImportManager . getExtensions ( ) . includes ( '.html' ) ) ;
66+ assert ( ImportManager . getExtensions ( ) . includes ( '.epub' ) ) ;
67+ assert ( ImportManager . getExtensions ( ) . includes ( '.js' ) ) ;
68+ assert ( ImportManager . getExtensions ( ) . includes ( '.css' ) ) ;
7269 } ) ;
7370
7471 it ( 'gets the correct types' , function ( ) {
7572 assert ( Array . isArray ( ImportManager . getContentTypes ( ) ) ) ;
76- assert . equal ( ImportManager . getContentTypes ( ) . length , 35 ) ;
73+ assert . equal ( ImportManager . getContentTypes ( ) . length , 24 ) ;
7774 assert ( ImportManager . getContentTypes ( ) . includes ( 'image/jpeg' ) ) ;
7875 assert ( ImportManager . getContentTypes ( ) . includes ( 'image/png' ) ) ;
7976 assert ( ImportManager . getContentTypes ( ) . includes ( 'image/gif' ) ) ;
@@ -94,26 +91,9 @@ describe('Importer', function () {
9491 assert ( ImportManager . getContentTypes ( ) . includes ( 'audio/ogg' ) ) ;
9592 assert ( ImportManager . getContentTypes ( ) . includes ( 'audio/x-m4a' ) ) ;
9693
97- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/pdf' ) ) ;
98- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/json' ) ) ;
99- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/ld+json' ) ) ;
100- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/vnd.oasis.opendocument.presentation' ) ) ;
101- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/vnd.oasis.opendocument.spreadsheet' ) ) ;
102- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/vnd.oasis.opendocument.text' ) ) ;
103- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/vnd.ms-powerpoint' ) ) ;
104- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/vnd.openxmlformats-officedocument.presentationml.presentation' ) ) ;
105- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/rtf' ) ) ;
106- assert ( ImportManager . getContentTypes ( ) . includes ( 'text/plain' ) ) ;
107- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/vnd.ms-excel' ) ) ;
108- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ) ;
109- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/xml' ) ) ;
110- assert ( ImportManager . getContentTypes ( ) . includes ( 'application/atom+xml' ) ) ;
111-
11294 assert ( ImportManager . getContentTypes ( ) . includes ( 'application/octet-stream' ) ) ;
11395 assert ( ImportManager . getContentTypes ( ) . includes ( 'application/json' ) ) ;
114-
11596 assert ( ImportManager . getContentTypes ( ) . includes ( 'text/plain' ) ) ;
116-
11797 assert ( ImportManager . getContentTypes ( ) . includes ( 'application/zip' ) ) ;
11898 assert ( ImportManager . getContentTypes ( ) . includes ( 'application/x-zip-compressed' ) ) ;
11999 } ) ;
@@ -128,17 +108,18 @@ describe('Importer', function () {
128108 } ) ;
129109
130110 it ( 'globs extensions correctly' , function ( ) {
131- assert . equal ( ImportManager . getGlobPattern ( ImportManager . getExtensions ( ) ) , '+(.jpg|.jpeg|.gif|.png|.svg|.svgz|.ico|.webp|.mp4|.webm|.ogv|.mp3|.wav|.ogg|.m4a|.pdf|.json|.jsonld|.odp|.ods|.odt|.ppt|.pptx|.rtf|.txt|.xls|.xlsx|.xml|.csv|.md|.markdown|.zip)' ) ;
111+ const extGlob = '+(.jpg|.jpeg|.gif|.png|.svg|.svgz|.ico|.webp|.mp4|.webm|.ogv|.mp3|.wav|.ogg|.m4a|.pdf|.json|.ods|.odt|.pptx|.rtf|.txt|.xls|.xlsx|.xml|.apkg|.css|.csv|.doc|.docx|.epub|.gpx|.html|.ics|.ipynb|.js|.key|.kml|.md|.mobi|.mov|.otf|.pages|.paprikarecipes|.psd|.py|.skp|.woff|.woff2|.xlsb|.xlsm|.yaml|.zip|.markdown)' ;
112+ assert . equal ( ImportManager . getGlobPattern ( ImportManager . getExtensions ( ) ) , extGlob ) ;
132113 assert . equal ( ImportManager . getGlobPattern ( ImportManager . getDirectories ( ) ) , '+(images|content|media|files)' ) ;
133114 assert . equal ( ImportManager . getGlobPattern ( JSONHandler . extensions ) , '+(.json)' ) ;
134115 assert . equal ( ImportManager . getGlobPattern ( ImageHandler . extensions ) , '+(.jpg|.jpeg|.gif|.png|.svg|.svgz|.ico|.webp)' ) ;
135- assert . equal ( ImportManager . getExtensionGlob ( ImportManager . getExtensions ( ) ) , '*+(.jpg|.jpeg|.gif|.png|.svg|.svgz|.ico|.webp|.mp4|.webm|.ogv|.mp3|.wav|.ogg|.m4a|.pdf|.json|.jsonld|.odp|.ods|.odt|.ppt|.pptx|.rtf|.txt|.xls|.xlsx|.xml|.csv|.md|.markdown|.zip)' ) ;
116+ assert . equal ( ImportManager . getExtensionGlob ( ImportManager . getExtensions ( ) ) , '*' + extGlob ) ;
136117 assert . equal ( ImportManager . getDirectoryGlob ( ImportManager . getDirectories ( ) ) , '+(images|content|media|files)' ) ;
137- assert . equal ( ImportManager . getExtensionGlob ( ImportManager . getExtensions ( ) , 0 ) , '*+(.jpg|.jpeg|.gif|.png|.svg|.svgz|.ico|.webp|.mp4|.webm|.ogv|.mp3|.wav|.ogg|.m4a|.pdf|.json|.jsonld|.odp|.ods|.odt|.ppt|.pptx|.rtf|.txt|.xls|.xlsx|.xml|.csv|.md|.markdown|.zip)' ) ;
118+ assert . equal ( ImportManager . getExtensionGlob ( ImportManager . getExtensions ( ) , 0 ) , '*' + extGlob ) ;
138119 assert . equal ( ImportManager . getDirectoryGlob ( ImportManager . getDirectories ( ) , 0 ) , '+(images|content|media|files)' ) ;
139- assert . equal ( ImportManager . getExtensionGlob ( ImportManager . getExtensions ( ) , 1 ) , '{*/*,*}+(.jpg|.jpeg|.gif|.png|.svg|.svgz|.ico|.webp|.mp4|.webm|.ogv|.mp3|.wav|.ogg|.m4a|.pdf|.json|.jsonld|.odp|.ods|.odt|.ppt|.pptx|.rtf|.txt|.xls|.xlsx|.xml|.csv|.md|.markdown|.zip)' ) ;
120+ assert . equal ( ImportManager . getExtensionGlob ( ImportManager . getExtensions ( ) , 1 ) , '{*/*,*}' + extGlob ) ;
140121 assert . equal ( ImportManager . getDirectoryGlob ( ImportManager . getDirectories ( ) , 1 ) , '{*/,}+(images|content|media|files)' ) ;
141- assert . equal ( ImportManager . getExtensionGlob ( ImportManager . getExtensions ( ) , 2 ) , '**/*+(.jpg|.jpeg|.gif|.png|.svg|.svgz|.ico|.webp|.mp4|.webm|.ogv|.mp3|.wav|.ogg|.m4a|.pdf|.json|.jsonld|.odp|.ods|.odt|.ppt|.pptx|.rtf|.txt|.xls|.xlsx|.xml|.csv|.md|.markdown|.zip)' ) ;
122+ assert . equal ( ImportManager . getExtensionGlob ( ImportManager . getExtensions ( ) , 2 ) , '**/*' + extGlob ) ;
142123 assert . equal ( ImportManager . getDirectoryGlob ( ImportManager . getDirectories ( ) , 2 ) , '**/+(images|content|media|files)' ) ;
143124 } ) ;
144125
0 commit comments