File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -1171,6 +1171,39 @@ t.test("it only allows some IP addresses", async () => {
1171
1171
} ) ;
1172
1172
} ) ;
1173
1173
1174
+ t . test ( "it includes agent's own package in heartbeat" , async ( ) => {
1175
+ const clock = FakeTimers . install ( ) ;
1176
+
1177
+ const logger = new LoggerNoop ( ) ;
1178
+ const api = new ReportingAPIForTesting ( ) ;
1179
+ const agent = createTestAgent ( {
1180
+ api,
1181
+ logger,
1182
+ token : new Token ( "123" ) ,
1183
+ suppressConsoleLog : false ,
1184
+ } ) ;
1185
+ agent . start ( [ ] ) ;
1186
+
1187
+ api . clear ( ) ;
1188
+
1189
+ await agent . flushStats ( 1000 ) ;
1190
+
1191
+ t . match ( api . getEvents ( ) , [
1192
+ {
1193
+ type : "heartbeat" ,
1194
+ packages : [
1195
+ {
1196
+ name : "@aikidosec/firewall" ,
1197
+ version : "0.0.0" ,
1198
+ requiredAt : 0 ,
1199
+ } ,
1200
+ ] ,
1201
+ } ,
1202
+ ] ) ;
1203
+
1204
+ clock . uninstall ( ) ;
1205
+ } ) ;
1206
+
1174
1207
t . test ( "packages are not cleared after heartbeat" , async ( ) => {
1175
1208
const clock = FakeTimers . install ( ) ;
1176
1209
You can’t perform that action at this time.
0 commit comments