Skip to content

Commit 35e5e01

Browse files
committed
Move method to test file
1 parent 28e3b04 commit 35e5e01

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed
Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict'
22

33
const csiMethods = [
4-
{ src: 'plusOperator', operator: true },
54
{ src: 'concat' },
5+
{ src: 'plusOperator', operator: true },
66
{ src: 'replace' },
77
{ src: 'slice' },
88
{ src: 'substr' },
@@ -12,19 +12,6 @@ const csiMethods = [
1212
{ src: 'trimStart', dst: 'trim' }
1313
]
1414

15-
function getExpectedMethods () {
16-
const set = new Set()
17-
for (const definition of csiMethods) {
18-
if (definition.dst) {
19-
set.add(definition.dst)
20-
} else {
21-
set.add(definition.src)
22-
}
23-
}
24-
return [...set]
25-
}
26-
2715
module.exports = {
28-
csiMethods,
29-
getExpectedMethods
16+
csiMethods
3017
}

packages/dd-trace/test/appsec/iast/taint-tracking/taint-tracking-operations.spec.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@
33
const { expect } = require('chai')
44
const proxyquire = require('proxyquire')
55
const iastContextFunctions = require('../../../../src/appsec/iast/iast-context')
6-
const { getExpectedMethods } = require('../../../../src/appsec/iast/taint-tracking/csi-methods')
6+
const { csiMethods } = require('../../../../src/appsec/iast/taint-tracking/csi-methods')
77
const iastTelemetry = require('../../../../src/appsec/iast/telemetry')
88
const { EXECUTED_PROPAGATION, REQUEST_TAINTED } = require('../../../../src/appsec/iast/telemetry/iast-metric')
99
const { Verbosity } = require('../../../../src/appsec/iast/telemetry/verbosity')
1010

11+
function getExpectedMethods () {
12+
const set = new Set()
13+
for (const definition of csiMethods) {
14+
if (definition.dst) {
15+
set.add(definition.dst)
16+
} else {
17+
set.add(definition.src)
18+
}
19+
}
20+
return [...set]
21+
}
22+
1123
describe('IAST TaintTracking Operations', () => {
1224
let taintTrackingOperations
1325
let taintTrackingImpl

0 commit comments

Comments
 (0)