@@ -19,6 +19,8 @@ describe('Generated documents', () => {
1919 it ( 'returns the right name for a registry event' , ( ) => {
2020 const extensions = { registry : { key : `HKLM/Windows/Software/abc` } } ;
2121 const event = generator . generateEvent ( { eventCategory : 'registry' , extensions } ) ;
22+ // casting to ResolverEvent here because the `descriptiveName` function is used by the frontend is still relies
23+ // on the unsafe ResolverEvent type. Once it's switched over to the safe version we can remove this cast.
2224 expect ( descriptiveName ( event as ResolverEvent ) ) . toEqual ( {
2325 subject : `HKLM/Windows/Software/abc` ,
2426 } ) ;
@@ -28,6 +30,8 @@ describe('Generated documents', () => {
2830 const randomIP = `${ generator . randomIP ( ) } ` ;
2931 const extensions = { network : { direction : 'outbound' , forwarded_ip : randomIP } } ;
3032 const event = generator . generateEvent ( { eventCategory : 'network' , extensions } ) ;
33+ // casting to ResolverEvent here because the `descriptiveName` function is used by the frontend is still relies
34+ // on the unsafe ResolverEvent type. Once it's switched over to the safe version we can remove this cast.
3135 expect ( descriptiveName ( event as ResolverEvent ) ) . toEqual ( {
3236 subject : `${ randomIP } ` ,
3337 descriptor : 'outbound' ,
@@ -37,6 +41,8 @@ describe('Generated documents', () => {
3741 it ( 'returns the right name for a file event' , ( ) => {
3842 const extensions = { file : { path : 'C:\\My Documents\\business\\January\\processName' } } ;
3943 const event = generator . generateEvent ( { eventCategory : 'file' , extensions } ) ;
44+ // casting to ResolverEvent here because the `descriptiveName` function is used by the frontend is still relies
45+ // on the unsafe ResolverEvent type. Once it's switched over to the safe version we can remove this cast.
4046 expect ( descriptiveName ( event as ResolverEvent ) ) . toEqual ( {
4147 subject : 'C:\\My Documents\\business\\January\\processName' ,
4248 } ) ;
@@ -45,6 +51,8 @@ describe('Generated documents', () => {
4551 it ( 'returns the right name for a dns event' , ( ) => {
4652 const extensions = { dns : { question : { name : `${ generator . randomIP ( ) } ` } } } ;
4753 const event = generator . generateEvent ( { eventCategory : 'dns' , extensions } ) ;
54+ // casting to ResolverEvent here because the `descriptiveName` function is used by the frontend is still relies
55+ // on the unsafe ResolverEvent type. Once it's switched over to the safe version we can remove this cast.
4856 expect ( descriptiveName ( event as ResolverEvent ) ) . toEqual ( {
4957 subject : extensions . dns . question . name ,
5058 } ) ;
0 commit comments