@@ -18,8 +18,10 @@ describe('rgb', () => {
1818 text : { } ,
1919 } ;
2020 const view = convertIndexedToRgb ( decodedImage ) ;
21+
2122 expect ( view ) . toStrictEqual ( Uint8Array . from ( [ 0 , 0 , 1 ] ) ) ;
2223 } ) ;
24+
2325 it ( '1 bit with multiple rows' , ( ) => {
2426 const palette : IndexedColors = [
2527 [ 0 , 0 , 1 ] ,
@@ -36,6 +38,7 @@ describe('rgb', () => {
3638 } ;
3739
3840 const view = convertIndexedToRgb ( decodedImage ) ;
41+
3942 expect ( view ) . toStrictEqual (
4043 Uint8Array . from ( [
4144 0 , 0 , 2 , 0 , 0 , 2 , 0 , 0 , 2 , 0 , 0 , 2 , 0 , 0 , 2 , 0 , 0 , 2 , 0 , 0 , 2 , 0 , 0 , 2 ,
@@ -61,6 +64,7 @@ describe('rgb', () => {
6164 } ;
6265
6366 const view = convertIndexedToRgb ( decodedImage ) ;
67+
6468 expect ( view ) . toStrictEqual ( Uint8Array . from ( [ 0 , 0 , 1 , 0 , 0 , 4 ] ) ) ;
6569 } ) ;
6670
@@ -82,6 +86,7 @@ describe('rgb', () => {
8286 } ;
8387
8488 const view = convertIndexedToRgb ( decodedImage ) ;
89+
8590 expect ( view ) . toStrictEqual (
8691 Uint8Array . from ( [
8792 0 , 0 , 4 , 0 , 0 , 4 , 0 , 0 , 4 , 0 , 0 , 3 , 0 , 0 , 1 , 0 , 0 , 4 , 0 , 0 , 4 , 0 , 0 , 4 ,
@@ -114,6 +119,7 @@ describe('rgb', () => {
114119 } ;
115120
116121 const view = convertIndexedToRgb ( decodedImage ) ;
122+
117123 expect ( view ) . toStrictEqual (
118124 Uint8Array . from ( [
119125 0 , 0 , 1 , 0 , 0 , 2 , 0 , 0 , 3 , 0 , 0 , 4 , 0 , 0 , 5 , 0 , 0 , 6 , 0 , 0 , 7 , 0 , 0 , 8 ,
@@ -145,6 +151,7 @@ describe('rgb', () => {
145151 } ;
146152
147153 const view = convertIndexedToRgb ( decodedImage ) ;
154+
148155 expect ( view ) . toStrictEqual (
149156 Uint8Array . from ( [
150157 0 , 0 , 1 , 0 , 0 , 2 , 0 , 0 , 3 , 0 , 0 , 4 , 0 , 0 , 0 , 0 , 0 , 5 , 0 , 0 , 6 , 0 , 0 , 7 ,
@@ -172,6 +179,7 @@ describe('rgb', () => {
172179 } ;
173180
174181 const view = convertIndexedToRgb ( decodedImage ) ;
182+
175183 expect ( view ) . toStrictEqual (
176184 Uint8Array . from ( [ 0 , 0 , 1 , 0 , 0 , 2 , 0 , 0 , 3 , 0 , 0 , 4 ] ) ,
177185 ) ;
@@ -181,7 +189,7 @@ describe('rgb', () => {
181189 const img = loadAndDecode ( 'palette.png' ) ;
182190
183191 expect ( img . palette ) . toBeDefined ( ) ;
184- expect ( img . depth ) . toStrictEqual ( 8 ) ;
192+ expect ( img . depth ) . toBe ( 8 ) ;
185193
186194 const data = convertIndexedToRgb ( img ) ;
187195 const newImg = encode ( {
@@ -195,12 +203,15 @@ describe('rgb', () => {
195203 // fs.writeFileSync(path.join(import.meta.dirname, "../../img/palette.new.png"), newImg, { flag: "w+" });
196204
197205 const newImageParsed = decode ( newImg ) ;
198- expect ( newImageParsed . data . byteLength ) . toStrictEqual ( 90000 ) ;
206+
207+ expect ( newImageParsed . data . byteLength ) . toBe ( 90000 ) ;
199208 } ) ;
209+
200210 it ( 'minecraft texture with tRNS ' , ( ) => {
201211 const img = loadAndDecode ( 'cocoa_stage2.png' ) ;
212+
202213 expect ( img . palette ) . toBeDefined ( ) ;
203- expect ( img . depth ) . toStrictEqual ( 4 ) ;
214+ expect ( img . depth ) . toBe ( 4 ) ;
204215
205216 const data = convertIndexedToRgb ( img ) ;
206217 const newImg = encode ( {
@@ -215,7 +226,7 @@ describe('rgb', () => {
215226
216227 const newImageParsed = decode ( newImg ) ;
217228
218- expect ( newImageParsed . data . byteLength ) . toStrictEqual ( 1024 ) ;
229+ expect ( newImageParsed . data . byteLength ) . toBe ( 1024 ) ;
219230 } ) ;
220231} ) ;
221232
@@ -236,6 +247,7 @@ describe('rgba', () => {
236247 } ;
237248
238249 const view = convertIndexedToRgb ( decodedImage ) ;
250+
239251 expect ( view ) . toStrictEqual (
240252 Uint8Array . from (
241253 [
@@ -251,6 +263,7 @@ describe('rgba', () => {
251263 ) ,
252264 ) ;
253265 } ) ;
266+
254267 it ( '4 bit with RGBA' , ( ) => {
255268 const palette : IndexedColors = [
256269 [ 0 , 0 , 0 , 25 ] ,
@@ -275,6 +288,7 @@ describe('rgba', () => {
275288 } ;
276289
277290 const view = convertIndexedToRgb ( decodedImage ) ;
291+
278292 expect ( view ) . toStrictEqual (
279293 Uint8Array . from ( [
280294 0 , 0 , 1 , 255 , 0 , 0 , 2 , 90 , 0 , 0 , 3 , 0 , 0 , 0 , 4 , 0 , 0 , 0 , 5 , 255 , 0 , 0 ,
@@ -294,10 +308,12 @@ describe('errors', () => {
294308 channels : 1 ,
295309 text : { } ,
296310 } ;
311+
297312 expect ( ( ) => {
298313 convertIndexedToRgb ( decodedImage ) ;
299314 } ) . toThrow ( 'Color palette is undefined.' ) ;
300315 } ) ;
316+
301317 it ( 'throws if data length is not correct' , ( ) => {
302318 const palette : IndexedColors = [
303319 [ 0 , 0 , 1 ] ,
0 commit comments