1- import test from 'tape' ;
1+ import assert from 'node:assert/strict' ;
2+ import test from 'node:test' ;
23import { DirectChat , MissionChat , CoTParser } from '../index.js' ;
34
4- test ( 'MissionChat - GeoJSON output' , async ( t ) => {
5+ test ( 'MissionChat - GeoJSON output' , async ( ) => {
56 const messageId = '6c19bcd5-c632-4c59-95e2-ae8c76c8feab' ;
67
78 const cot = new MissionChat ( {
@@ -32,7 +33,7 @@ test('MissionChat - GeoJSON output', async (t) => {
3233 cot . raw . event . point . _attributes . lat = 39.078503 ;
3334 cot . raw . event . point . _attributes . hae = 1393.296 ;
3435
35- t . deepEquals ( await CoTParser . to_geojson ( cot ) , {
36+ assert . deepEqual ( await CoTParser . to_geojson ( cot ) , {
3637 id : `GeoChat.ANDROID-764679f74013dfe2.ops.cotak.gov-8443-ssl-Test Attachments.${ messageId } ` ,
3738 type : 'Feature' ,
3839 path : '/' ,
@@ -73,11 +74,9 @@ test('MissionChat - GeoJSON output', async (t) => {
7374 coordinates : [ - 108.537452 , 39.078503 , 1393.296 ]
7475 }
7576 } ) ;
76-
77- t . end ( ) ;
7877} ) ;
7978
80- test ( 'DirectChat - Basic' , ( t ) => {
79+ test ( 'DirectChat - Basic' , ( ) => {
8180 const cot = new DirectChat ( {
8281 to : {
8382 uid : '123456' ,
@@ -90,36 +89,36 @@ test('DirectChat - Basic', (t) => {
9089 message : 'Direct Message Test'
9190 } ) ;
9291
93- t . equals ( cot . is_chat ( ) , true ) ;
92+ assert . equal ( cot . is_chat ( ) , true ) ;
9493
95- t . ok ( cot . raw . event . _attributes . uid ) ;
94+ assert . ok ( cot . raw . event . _attributes . uid ) ;
9695 cot . raw . event . _attributes . uid = '123' ;
9796
9897 if ( ! cot . raw . event . detail ) {
99- t . fail ( 'No Detail Section' )
98+ assert . fail ( 'No Detail Section' )
10099 } else {
101- t . equals ( typeof cot . raw . event . _attributes . time , 'string' ) ;
100+ assert . equal ( typeof cot . raw . event . _attributes . time , 'string' ) ;
102101 cot . raw . event . _attributes . time = '2024-04-01'
103- t . equals ( typeof cot . raw . event . _attributes . start , 'string' ) ;
102+ assert . equal ( typeof cot . raw . event . _attributes . start , 'string' ) ;
104103 cot . raw . event . _attributes . start = '2024-04-01'
105- t . equals ( typeof cot . raw . event . _attributes . stale , 'string' ) ;
104+ assert . equal ( typeof cot . raw . event . _attributes . stale , 'string' ) ;
106105 cot . raw . event . _attributes . stale = '2024-04-01'
107106
108107 if ( ! cot . raw . event . detail . __chat ) {
109- t . fail ( 'No Chat Section' )
108+ assert . fail ( 'No Chat Section' )
110109 } else {
111- t . equals ( typeof cot . raw . event . detail . __chat . _attributes . messageId , 'string' ) ;
110+ assert . equal ( typeof cot . raw . event . detail . __chat . _attributes . messageId , 'string' ) ;
112111 cot . raw . event . detail . __chat . _attributes . messageId = '123' ;
113112 }
114113
115114 if ( ! cot . raw . event . detail . remarks || ! cot . raw . event . detail . remarks . _attributes ) {
116- t . fail ( 'No Remarks Section' )
115+ assert . fail ( 'No Remarks Section' )
117116 } else {
118- t . equals ( typeof cot . raw . event . detail . remarks . _attributes . time , 'string' ) ;
117+ assert . equal ( typeof cot . raw . event . detail . remarks . _attributes . time , 'string' ) ;
119118 cot . raw . event . detail . remarks . _attributes . time = '123' ;
120119 }
121120
122- t . deepEquals ( cot . raw , {
121+ assert . deepEqual ( cot . raw , {
123122 event : {
124123 _attributes : {
125124 uid : '123' ,
@@ -178,6 +177,4 @@ test('DirectChat - Basic', (t) => {
178177 }
179178 } ) ;
180179 }
181-
182- t . end ( ) ;
183180} ) ;
0 commit comments