@@ -121,21 +121,21 @@ describeWithEnvironment('ResourceType class', () => {
121121 it ( 'is able to return an wasm resource from the string "application/wasm"' , ( ) => {
122122 const result = ResourceType . fromMimeTypeOverride ( 'application/wasm' ) ;
123123 assert . instanceOf ( result , ResourceType , 'result type is incorrect' ) ;
124- assert . strictEqual ( result ! . name ( ) , 'wasm' , 'name was not set correctly' ) ;
125- assert . strictEqual ( result ! . title ( ) , 'Wasm' , 'title was not set correctly' ) ;
126- assert . strictEqual ( result ! . category ( ) . title ( ) , 'WebAssembly' , 'category title was not set correctly' ) ;
127- assert . strictEqual ( result ! . category ( ) . shortTitle ( ) , 'Wasm' , 'category short title was not set correctly' ) ;
128- assert . isFalse ( result ! . isTextType ( ) , 'resource type was not set correctly' ) ;
124+ assert . strictEqual ( result . name ( ) , 'wasm' , 'name was not set correctly' ) ;
125+ assert . strictEqual ( result . title ( ) , 'Wasm' , 'title was not set correctly' ) ;
126+ assert . strictEqual ( result . category ( ) . title ( ) , 'WebAssembly' , 'category title was not set correctly' ) ;
127+ assert . strictEqual ( result . category ( ) . shortTitle ( ) , 'Wasm' , 'category short title was not set correctly' ) ;
128+ assert . isFalse ( result . isTextType ( ) , 'resource type was not set correctly' ) ;
129129 } ) ;
130130
131131 it ( 'is able to return an web bundle resource from the string "application/webbundle"' , ( ) => {
132132 const result = ResourceType . fromMimeTypeOverride ( 'application/webbundle' ) ;
133133 assert . instanceOf ( result , ResourceType , 'result type is incorrect' ) ;
134- assert . strictEqual ( result ! . name ( ) , 'webbundle' , 'name was not set correctly' ) ;
135- assert . strictEqual ( result ! . title ( ) , 'WebBundle' , 'title was not set correctly' ) ;
136- assert . strictEqual ( result ! . category ( ) . title ( ) , 'Other' , 'category title was not set correctly' ) ;
137- assert . strictEqual ( result ! . category ( ) . shortTitle ( ) , 'Other' , 'category short title was not set correctly' ) ;
138- assert . isFalse ( result ! . isTextType ( ) , 'resource type was not set correctly' ) ;
134+ assert . strictEqual ( result . name ( ) , 'webbundle' , 'name was not set correctly' ) ;
135+ assert . strictEqual ( result . title ( ) , 'WebBundle' , 'title was not set correctly' ) ;
136+ assert . strictEqual ( result . category ( ) . title ( ) , 'Other' , 'category title was not set correctly' ) ;
137+ assert . strictEqual ( result . category ( ) . shortTitle ( ) , 'Other' , 'category short title was not set correctly' ) ;
138+ assert . isFalse ( result . isTextType ( ) , 'resource type was not set correctly' ) ;
139139 } ) ;
140140
141141 it ( 'is able to return a resource of type other from the string "test/resource"' , ( ) => {
@@ -151,41 +151,41 @@ describeWithEnvironment('ResourceType class', () => {
151151 it ( 'is able to return a resource type from a URL that contains a mapped extension' , ( ) => {
152152 const result = ResourceType . fromURL ( 'http://www.example.com/test/testFile.js' ) ;
153153 assert . instanceOf ( result , ResourceType , 'result type is incorrect' ) ;
154- assert . strictEqual ( result ! . name ( ) , 'script' , 'name was not set correctly' ) ;
155- assert . strictEqual ( result ! . title ( ) , 'Script' , 'title was not set correctly' ) ;
156- assert . strictEqual ( result ! . category ( ) . title ( ) , 'JavaScript' , 'category title was not set correctly' ) ;
157- assert . strictEqual ( result ! . category ( ) . shortTitle ( ) , 'JS' , 'category short title was not set correctly' ) ;
158- assert . isTrue ( result ! . isTextType ( ) , 'resource type was not set correctly' ) ;
154+ assert . strictEqual ( result . name ( ) , 'script' , 'name was not set correctly' ) ;
155+ assert . strictEqual ( result . title ( ) , 'Script' , 'title was not set correctly' ) ;
156+ assert . strictEqual ( result . category ( ) . title ( ) , 'JavaScript' , 'category title was not set correctly' ) ;
157+ assert . strictEqual ( result . category ( ) . shortTitle ( ) , 'JS' , 'category short title was not set correctly' ) ;
158+ assert . isTrue ( result . isTextType ( ) , 'resource type was not set correctly' ) ;
159159 } ) ;
160160
161161 it ( 'is able to return a resource type from a URL that ends in .avif' , ( ) => {
162162 const result = ResourceType . fromURL ( 'https://host.example/image.avif' ) ;
163163 assert . instanceOf ( result , ResourceType , 'result type is incorrect' ) ;
164- assert . strictEqual ( result ! . name ( ) , 'image' , 'name was not set correctly' ) ;
165- assert . strictEqual ( result ! . title ( ) , 'Image' , 'title was not set correctly' ) ;
166- assert . strictEqual ( result ! . category ( ) . title ( ) , 'Image' , 'category title was not set correctly' ) ;
167- assert . strictEqual ( result ! . category ( ) . shortTitle ( ) , 'Img' , 'category short title was not set correctly' ) ;
168- assert . isTrue ( result ! . isImage ( ) , 'resource type was not set correctly' ) ;
164+ assert . strictEqual ( result . name ( ) , 'image' , 'name was not set correctly' ) ;
165+ assert . strictEqual ( result . title ( ) , 'Image' , 'title was not set correctly' ) ;
166+ assert . strictEqual ( result . category ( ) . title ( ) , 'Image' , 'category title was not set correctly' ) ;
167+ assert . strictEqual ( result . category ( ) . shortTitle ( ) , 'Img' , 'category short title was not set correctly' ) ;
168+ assert . isTrue ( result . isImage ( ) , 'resource type was not set correctly' ) ;
169169 } ) ;
170170
171171 it ( 'is able to return a resource type from a URL that ends in .jxl' , ( ) => {
172172 const result = ResourceType . fromURL ( 'https://host.example/image.jxl' ) ;
173173 assert . instanceOf ( result , ResourceType , 'result type is incorrect' ) ;
174- assert . strictEqual ( result ! . name ( ) , 'image' , 'name was not set correctly' ) ;
175- assert . strictEqual ( result ! . title ( ) , 'Image' , 'title was not set correctly' ) ;
176- assert . strictEqual ( result ! . category ( ) . title ( ) , 'Image' , 'category title was not set correctly' ) ;
177- assert . strictEqual ( result ! . category ( ) . shortTitle ( ) , 'Img' , 'category short title was not set correctly' ) ;
178- assert . isTrue ( result ! . isImage ( ) , 'resource type was not set correctly' ) ;
174+ assert . strictEqual ( result . name ( ) , 'image' , 'name was not set correctly' ) ;
175+ assert . strictEqual ( result . title ( ) , 'Image' , 'title was not set correctly' ) ;
176+ assert . strictEqual ( result . category ( ) . title ( ) , 'Image' , 'category title was not set correctly' ) ;
177+ assert . strictEqual ( result . category ( ) . shortTitle ( ) , 'Img' , 'category short title was not set correctly' ) ;
178+ assert . isTrue ( result . isImage ( ) , 'resource type was not set correctly' ) ;
179179 } ) ;
180180
181181 it ( 'is able to return a resource type from a URL that ends in .woff2' , ( ) => {
182182 const result = ResourceType . fromURL ( 'https://host.example/image.woff2' ) ;
183183 assert . instanceOf ( result , ResourceType , 'result type is incorrect' ) ;
184- assert . strictEqual ( result ! . name ( ) , 'font' , 'name was not set correctly' ) ;
185- assert . strictEqual ( result ! . title ( ) , 'Font' , 'title was not set correctly' ) ;
186- assert . strictEqual ( result ! . category ( ) . title ( ) , 'Font' , 'category title was not set correctly' ) ;
187- assert . strictEqual ( result ! . category ( ) . shortTitle ( ) , 'Font' , 'category short title was not set correctly' ) ;
188- assert . isFalse ( result ! . isTextType ( ) , 'resource type was not set correctly' ) ;
184+ assert . strictEqual ( result . name ( ) , 'font' , 'name was not set correctly' ) ;
185+ assert . strictEqual ( result . title ( ) , 'Font' , 'title was not set correctly' ) ;
186+ assert . strictEqual ( result . category ( ) . title ( ) , 'Font' , 'category title was not set correctly' ) ;
187+ assert . strictEqual ( result . category ( ) . shortTitle ( ) , 'Font' , 'category short title was not set correctly' ) ;
188+ assert . isFalse ( result . isTextType ( ) , 'resource type was not set correctly' ) ;
189189 } ) ;
190190
191191 it ( 'is able to return null from a URL that contains an unmapped extension' , ( ) => {
@@ -196,11 +196,11 @@ describeWithEnvironment('ResourceType class', () => {
196196 it ( 'is able to return a resource type from a mapped name' , ( ) => {
197197 const result = ResourceType . fromName ( 'script' ) ;
198198 assert . instanceOf ( result , ResourceType , 'result type is incorrect' ) ;
199- assert . strictEqual ( result ! . name ( ) , 'script' , 'name was not set correctly' ) ;
200- assert . strictEqual ( result ! . title ( ) , 'Script' , 'title was not set correctly' ) ;
201- assert . strictEqual ( result ! . category ( ) . title ( ) , 'JavaScript' , 'category title was not set correctly' ) ;
202- assert . strictEqual ( result ! . category ( ) . shortTitle ( ) , 'JS' , 'category short title was not set correctly' ) ;
203- assert . isTrue ( result ! . isTextType ( ) , 'resource type was not set correctly' ) ;
199+ assert . strictEqual ( result . name ( ) , 'script' , 'name was not set correctly' ) ;
200+ assert . strictEqual ( result . title ( ) , 'Script' , 'title was not set correctly' ) ;
201+ assert . strictEqual ( result . category ( ) . title ( ) , 'JavaScript' , 'category title was not set correctly' ) ;
202+ assert . strictEqual ( result . category ( ) . shortTitle ( ) , 'JS' , 'category short title was not set correctly' ) ;
203+ assert . isTrue ( result . isTextType ( ) , 'resource type was not set correctly' ) ;
204204 } ) ;
205205
206206 it ( 'is able to return null from an unmapped name' , ( ) => {
0 commit comments