Skip to content

Commit

Permalink
Unify reportSchemas and reportFingerprint test in one suite
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlesDD committed Oct 8, 2024
1 parent 9137f25 commit ac364fa
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions packages/dd-trace/test/appsec/reporter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,35 +325,6 @@ describe('reporter', () => {
expect(span.addTags).to.be.calledOnceWithExactly({})
})

it('should call addTags', () => {
const schemaValue = [{ key: [8] }]
const derivatives = {
'_dd.appsec.fp.http.endpoint': 'endpoint_fingerprint',
'_dd.appsec.fp.http.header': 'header_fingerprint',
'_dd.appsec.fp.http.network': 'network_fingerprint',
'_dd.appsec.fp.session': 'session_fingerprint',
'_dd.appsec.s.req.headers': schemaValue,
'_dd.appsec.s.req.query': schemaValue,
'_dd.appsec.s.req.params': schemaValue,
'_dd.appsec.s.req.cookies': schemaValue,
'_dd.appsec.s.req.body': schemaValue,
'custom.processor.output': schemaValue
}

Reporter.reportDerivatives(derivatives)

const schemaEncoded = zlib.gzipSync(JSON.stringify(schemaValue)).toString('base64')
expect(span.addTags).to.be.calledOnce
expect(span.addTags).to.be.calledWithMatch({
'_dd.appsec.s.req.headers': schemaEncoded,
'_dd.appsec.s.req.query': schemaEncoded,
'_dd.appsec.s.req.params': schemaEncoded,
'_dd.appsec.s.req.cookies': schemaEncoded,
'_dd.appsec.s.req.body': schemaEncoded,
'custom.processor.output': schemaEncoded
})
})

it('should call addTags', () => {
const schemaValue = [{ key: [8] }]
const derivatives = {
Expand Down

0 comments on commit ac364fa

Please sign in to comment.