@@ -42,10 +42,10 @@ describe('command encoder', () => {
4242 ] ,
4343 [
4444 'start user program with slot' ,
45- sendStartUserProgramCommand ( 0 , 0x2A ) ,
45+ sendStartUserProgramCommand ( 0 , 0x2a ) ,
4646 [
4747 0x01 , // start user program command
48- 0x2A , // program slot
48+ 0x2a , // program slot
4949 ] ,
5050 ] ,
5151 [
@@ -94,11 +94,11 @@ describe('command encoder', () => {
9494 ] ,
9595 [
9696 'write appdata' ,
97- sendWriteAppDataCommand ( 0 , 0x2A , new Uint8Array ( [ 1 , 2 , 3 , 4 ] ) . buffer ) ,
97+ sendWriteAppDataCommand ( 0 , 0x2a , new Uint8Array ( [ 1 , 2 , 3 , 4 ] ) . buffer ) ,
9898 [
9999 0x07 , // write appdata command
100100 0x00 , // offset msb 16bit
101- 0x2A , // offset lsb 16bit
101+ 0x2a , // offset lsb 16bit
102102 0x01 , // payload start
103103 0x02 ,
104104 0x03 ,
@@ -237,28 +237,31 @@ describe('event decoder', () => {
237237 ] ) . buffer ,
238238 ) ,
239239 true ,
240- false
240+ false ,
241241 ] ,
242- ] ) ( 'decode %s event' , async ( _n , message , expected , isEqual = true , isStrictlyEqual = true ) => {
243- const saga = new AsyncSaga ( blePybricksService ) ;
244- const notification = new Uint8Array ( message ) ;
242+ ] ) (
243+ 'decode %s event' ,
244+ async ( _n , message , expected , isEqual = true , isStrictlyEqual = true ) => {
245+ const saga = new AsyncSaga ( blePybricksService ) ;
246+ const notification = new Uint8Array ( message ) ;
245247
246- saga . put ( didNotifyEvent ( new DataView ( notification . buffer ) ) ) ;
248+ saga . put ( didNotifyEvent ( new DataView ( notification . buffer ) ) ) ;
247249
248- const action = await saga . take ( ) ;
249- if ( isEqual ) {
250- expect ( action ) . toEqual ( expected ) ;
251- } else {
252- expect ( action ) . not . toEqual ( expected ) ;
253- }
254- if ( isStrictlyEqual ) {
255- expect ( action ) . toStrictEqual ( expected ) ;
256- } else {
257- expect ( action ) . not . toStrictEqual ( expected ) ;
258- }
250+ const action = await saga . take ( ) ;
251+ if ( isEqual ) {
252+ expect ( action ) . toEqual ( expected ) ;
253+ } else {
254+ expect ( action ) . not . toEqual ( expected ) ;
255+ }
256+ if ( isStrictlyEqual ) {
257+ expect ( action ) . toStrictEqual ( expected ) ;
258+ } else {
259+ expect ( action ) . not . toStrictEqual ( expected ) ;
260+ }
259261
260- await saga . end ( ) ;
261- } ) ;
262+ await saga . end ( ) ;
263+ } ,
264+ ) ;
262265
263266 test . each ( [
264267 [
0 commit comments