@@ -24,9 +24,8 @@ const props = [
2424
2525const methods = [ 'on' , 'save' , 'drawImage' ] as const ;
2626
27- const testDataPath = ( name : string ) : string => (
28- path . resolve ( import . meta. dirname , '..' , 'examples' , 'assets' , name )
29- ) ;
27+ const testDataPath = ( name : string ) : string =>
28+ path . resolve ( import . meta. dirname , '..' , 'examples' , 'assets' , name ) ;
3029
3130const loadImageAsync = async ( name : string ) : Promise < Image > => {
3231 const image = new Image ( ) ;
@@ -90,7 +89,9 @@ describe('Image', () => {
9089 const image = new Image ( ) ;
9190
9291 const that = await new Promise ( ( res , rej ) => {
93- image . addEventListener ( 'load' , function onLoad ( this : Image ) { res ( this ) ; } ) ;
92+ image . addEventListener ( 'load' , function onLoad ( this : Image ) {
93+ res ( this ) ;
94+ } ) ;
9495 image . addEventListener ( 'error' , rej ) ;
9596 image . src = testDataPath ( 'freeimage.jpg' ) ;
9697 } ) ;
@@ -102,7 +103,9 @@ describe('Image', () => {
102103 const image = await loadImageAsync ( 'freeimage.jpg' ) ;
103104
104105 const that = await new Promise ( ( res , rej ) => {
105- image . addEventListener ( 'load' , function onLoad ( this : Image ) { res ( this ) ; } ) ;
106+ image . addEventListener ( 'load' , function onLoad ( this : Image ) {
107+ res ( this ) ;
108+ } ) ;
106109 image . addEventListener ( 'error' , rej ) ;
107110 } ) ;
108111
@@ -113,7 +116,9 @@ describe('Image', () => {
113116 const image = new Image ( ) ;
114117
115118 const that = await new Promise ( ( res , rej ) => {
116- image . on ( 'load' , function onLoad ( this : Image ) { res ( this ) ; } ) ;
119+ image . on ( 'load' , function onLoad ( this : Image ) {
120+ res ( this ) ;
121+ } ) ;
117122 image . on ( 'error' , rej ) ;
118123 image . src = testDataPath ( 'freeimage.jpg' ) ;
119124 } ) ;
@@ -125,7 +130,9 @@ describe('Image', () => {
125130 const image = await loadImageAsync ( 'freeimage.jpg' ) ;
126131
127132 const that = await new Promise ( ( res , rej ) => {
128- image . on ( 'load' , function onLoad ( this : Image ) { res ( this ) ; } ) ;
133+ image . on ( 'load' , function onLoad ( this : Image ) {
134+ res ( this ) ;
135+ } ) ;
129136 image . on ( 'error' , rej ) ;
130137 } ) ;
131138
@@ -136,7 +143,9 @@ describe('Image', () => {
136143 const image = new Image ( ) ;
137144
138145 const that = await new Promise ( ( res , rej ) => {
139- image . once ( 'load' , function onLoad ( this : Image ) { res ( this ) ; } ) ;
146+ image . once ( 'load' , function onLoad ( this : Image ) {
147+ res ( this ) ;
148+ } ) ;
140149 image . once ( 'error' , rej ) ;
141150 image . src = testDataPath ( 'freeimage.jpg' ) ;
142151 } ) ;
@@ -148,7 +157,9 @@ describe('Image', () => {
148157 const image = await loadImageAsync ( 'freeimage.jpg' ) ;
149158
150159 const that = await new Promise ( ( res , rej ) => {
151- image . once ( 'load' , function onLoad ( this : Image ) { res ( this ) ; } ) ;
160+ image . once ( 'load' , function onLoad ( this : Image ) {
161+ res ( this ) ;
162+ } ) ;
152163 image . once ( 'error' , rej ) ;
153164 } ) ;
154165
0 commit comments