11import test from 'node:test'
22import assert from 'node:assert'
33
4- import { ApplicationTag , BACNetAppData , CalendarWeekDay , CalendarDateRange } from '../../src'
4+ import {
5+ ApplicationTag ,
6+ BACNetAppData ,
7+ CalendarWeekDay ,
8+ CalendarDateRange ,
9+ } from '../../src'
510
611test . describe ( 'ApplicationData types' , ( ) => {
712 test ( 'should correctly type OCTET_STRING as number[]' , ( ) => {
813 const octetStringData : BACNetAppData < ApplicationTag . OCTET_STRING > = {
914 type : ApplicationTag . OCTET_STRING ,
1015 value : [ 0x01 , 0x02 , 0x03 , 0x04 ] ,
1116 }
12-
17+
1318 assert . strictEqual ( octetStringData . type , ApplicationTag . OCTET_STRING )
1419 assert . ok ( Array . isArray ( octetStringData . value ) )
1520 assert . strictEqual ( octetStringData . value [ 0 ] , 0x01 )
@@ -20,7 +25,7 @@ test.describe('ApplicationData types', () => {
2025 type : ApplicationTag . BOOLEAN ,
2126 value : true ,
2227 }
23-
28+
2429 assert . strictEqual ( booleanData . type , ApplicationTag . BOOLEAN )
2530 assert . strictEqual ( typeof booleanData . value , 'boolean' )
2631 assert . strictEqual ( booleanData . value , true )
@@ -31,7 +36,7 @@ test.describe('ApplicationData types', () => {
3136 type : ApplicationTag . EMPTYLIST ,
3237 value : [ ] ,
3338 }
34-
39+
3540 assert . strictEqual ( emptyListData . type , ApplicationTag . EMPTYLIST )
3641 assert . ok ( Array . isArray ( emptyListData . value ) )
3742 assert . strictEqual ( emptyListData . value . length , 0 )
@@ -47,7 +52,7 @@ test.describe('ApplicationData types', () => {
4752 wday : 1 ,
4853 } as CalendarWeekDay ,
4954 }
50-
55+
5156 assert . strictEqual ( weekDayData . type , ApplicationTag . WEEKNDAY )
5257 assert . strictEqual ( typeof weekDayData . value , 'object' )
5358 assert . strictEqual ( weekDayData . value . month , 1 )
@@ -68,7 +73,7 @@ test.describe('ApplicationData types', () => {
6873 } ,
6974 } as CalendarDateRange ,
7075 }
71-
76+
7277 assert . strictEqual ( dateRangeData . type , ApplicationTag . DATERANGE )
7378 assert . strictEqual ( typeof dateRangeData . value , 'object' )
7479 assert . strictEqual ( dateRangeData . value . len , 16 )
@@ -79,7 +84,7 @@ test.describe('ApplicationData types', () => {
7984 type : ApplicationTag . DATETIME ,
8085 value : new Date ( '2024-01-01T12:00:00Z' ) ,
8186 }
82-
87+
8388 assert . strictEqual ( dateTimeData . type , ApplicationTag . DATETIME )
8489 assert . ok ( dateTimeData . value instanceof Date )
8590 assert . strictEqual ( dateTimeData . value . getFullYear ( ) , 2024 )
@@ -97,8 +102,8 @@ test.describe('ApplicationData types', () => {
97102 ] ,
98103 } as unknown ,
99104 }
100-
105+
101106 assert . strictEqual ( complexData . type , ApplicationTag . WEEKLY_SCHEDULE )
102107 assert . strictEqual ( typeof complexData . value , 'object' )
103108 } )
104- } )
109+ } )
0 commit comments