@@ -76,22 +76,13 @@ describe('masks', () => {
7676 const dimX = 6 ;
7777 const dimY = id === 4 ? 4 : 6 ;
7878
79- it ( 'returns true or false for any given pixel location' , ( ) => {
80- for ( let y = 0 ; y < 10 ; ++ y ) {
81- for ( let x = 0 ; x < 10 ; ++ x ) {
82- const value = mask ( x , y ) ;
83- expect ( typeof value ) . toEqual ( 'boolean' ) ;
84- }
85- }
86- } ) ;
87-
8879 it ( `defines a repeating ${ dimX } x${ dimY } pattern` , ( ) => {
8980 for ( let y = 0 ; y < dimY ; ++ y ) {
9081 for ( let x = 0 ; x < dimX ; ++ x ) {
91- const value = mask ( x , y ) ;
92- expect ( value ) . toEqual ( mask ( x + dimX , y ) ) ;
93- expect ( value ) . toEqual ( mask ( x , y + dimY ) ) ;
94- expect ( value ) . toEqual ( mask ( x + dimX , y + dimY ) ) ;
82+ const value = Boolean ( mask ( x , y ) ) ;
83+ expect ( value ) . toEqual ( Boolean ( mask ( x + dimX , y ) ) ) ;
84+ expect ( value ) . toEqual ( Boolean ( mask ( x , y + dimY ) ) ) ;
85+ expect ( value ) . toEqual ( Boolean ( mask ( x + dimX , y + dimY ) ) ) ;
9586 }
9687 }
9788 } ) ;
@@ -100,7 +91,7 @@ describe('masks', () => {
10091 let actual = '' ;
10192 for ( let y = 0 ; y < dimY ; ++ y ) {
10293 for ( let x = 0 ; x < dimX ; ++ x ) {
103- actual += mask ( x , y ) ? '# ' : ' ' ;
94+ actual += mask ( x , y ) ? ' ' : '# ' ;
10495 }
10596 actual += '\n' ;
10697 }
0 commit comments