Skip to content

Commit 1f26dcb

Browse files
authored
Remove reportAttack return value check (#6223)
1 parent da7c192 commit 1f26dcb

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

packages/dd-trace/test/appsec/reporter.spec.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -381,16 +381,14 @@ describe('reporter', () => {
381381
it('should add tags to request span when socket is not there', () => {
382382
delete req.socket
383383

384-
const result = Reporter.reportAttack([
384+
Reporter.reportAttack([
385385
{
386386
rule: {},
387387
rule_matches: [{}]
388388
}
389389
])
390390

391-
expect(result).to.not.be.false
392391
expect(web.root).to.have.been.calledOnceWith(req)
393-
394392
expect(span.addTags).to.have.been.calledOnceWithExactly({
395393
'appsec.event': 'true',
396394
'_dd.origin': 'appsec',
@@ -399,15 +397,14 @@ describe('reporter', () => {
399397
})
400398

401399
it('should add tags to request span', () => {
402-
const result = Reporter.reportAttack([
400+
Reporter.reportAttack([
403401
{
404402
rule: {},
405403
rule_matches: [{}]
406404
}
407405
])
408-
expect(result).to.not.be.false
409-
expect(web.root).to.have.been.calledOnceWith(req)
410406

407+
expect(web.root).to.have.been.calledOnceWith(req)
411408
expect(span.addTags).to.have.been.calledOnceWithExactly({
412409
'appsec.event': 'true',
413410
'_dd.origin': 'appsec',
@@ -419,10 +416,9 @@ describe('reporter', () => {
419416
it('should not overwrite origin tag', () => {
420417
span.context()._tags = { '_dd.origin': 'tracer' }
421418

422-
const result = Reporter.reportAttack([])
423-
expect(result).to.not.be.false
424-
expect(web.root).to.have.been.calledOnceWith(req)
419+
Reporter.reportAttack([])
425420

421+
expect(web.root).to.have.been.calledOnceWith(req)
426422
expect(span.addTags).to.have.been.calledOnceWithExactly({
427423
'appsec.event': 'true',
428424
'_dd.appsec.json': '{"triggers":[]}',
@@ -433,7 +429,7 @@ describe('reporter', () => {
433429
it('should merge attacks json', () => {
434430
span.context()._tags = { '_dd.appsec.json': '{"triggers":[{"rule":{},"rule_matches":[{}]}]}' }
435431

436-
const result = Reporter.reportAttack([
432+
Reporter.reportAttack([
437433
{
438434
rule: {}
439435
},
@@ -442,9 +438,8 @@ describe('reporter', () => {
442438
rule_matches: [{}]
443439
}
444440
])
445-
expect(result).to.not.be.false
446-
expect(web.root).to.have.been.calledOnceWith(req)
447441

442+
expect(web.root).to.have.been.calledOnceWith(req)
448443
expect(span.addTags).to.have.been.calledOnceWithExactly({
449444
'appsec.event': 'true',
450445
'_dd.origin': 'appsec',
@@ -456,7 +451,7 @@ describe('reporter', () => {
456451
it('should call standalone sample', () => {
457452
span.context()._tags = { '_dd.appsec.json': '{"triggers":[{"rule":{},"rule_matches":[{}]}]}' }
458453

459-
const result = Reporter.reportAttack([
454+
Reporter.reportAttack([
460455
{
461456
rule: {}
462457
},
@@ -465,9 +460,8 @@ describe('reporter', () => {
465460
rule_matches: [{}]
466461
}
467462
])
468-
expect(result).to.not.be.false
469-
expect(web.root).to.have.been.calledOnceWith(req)
470463

464+
expect(web.root).to.have.been.calledOnceWith(req)
471465
expect(span.addTags).to.have.been.calledOnceWithExactly({
472466
'appsec.event': 'true',
473467
'_dd.origin': 'appsec',

0 commit comments

Comments
 (0)