Skip to content

Commit 851e7ec

Browse files
authored
fix(aap): Fix appsec test for sinon.js 21.0.1 (#7233)
* Bump sinon.js to 21.0.1 * Workaround for sinon spies in appsec test
1 parent e996e29 commit 851e7ec

4 files changed

Lines changed: 23 additions & 13 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
"retry": "^0.13.1",
181181
"semifies": "^1.0.0",
182182
"semver": "^7.7.2",
183-
"sinon": "^21.0.0",
183+
"sinon": "^21.0.1",
184184
"tiktoken": "^1.0.21",
185185
"typescript": "^5.9.2",
186186
"workerpool": "^10.0.0",

packages/dd-trace/test/appsec/index.express.plugin.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ withVersions('express', 'express', version => {
8282

8383
afterEach(() => {
8484
appsec.disable()
85+
// TODO: Remove the workaround once https://github.com/sinonjs/sinon/issues/2671 is resolved
86+
paramCallbackSpy.resetHistory()
8587
sinon.reset()
8688
})
8789

packages/dd-trace/test/appsec/index.fastify.plugin.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ withVersions('fastify', 'fastify', '>=2', (fastifyVersion, _, fastifyLoadedVersi
322322

323323
afterEach(() => {
324324
appsec.disable()
325+
// TODO: Remove the workaround once https://github.com/sinonjs/sinon/issues/2671 is resolved
326+
preHandlerHookSpy.resetHistory()
327+
preValidationHookSpy.resetHistory()
325328
sinon.reset()
326329
})
327330

yarn.lock

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -698,14 +698,14 @@
698698
dependencies:
699699
type-detect "4.0.8"
700700

701-
"@sinonjs/fake-timers@^13.0.5":
702-
version "13.0.5"
703-
resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz#36b9dbc21ad5546486ea9173d6bea063eb1717d5"
704-
integrity sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==
701+
"@sinonjs/fake-timers@^15.1.0":
702+
version "15.1.0"
703+
resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-15.1.0.tgz#f42e713425d4eb1a7bc88ef5d7f76c4546586c25"
704+
integrity sha512-cqfapCxwTGsrR80FEgOoPsTonoefMBY7dnUEbQ+GRcved0jvkJLzvX6F4WtN+HBqbPX/SiFsIRUp+IrCW/2I2w==
705705
dependencies:
706706
"@sinonjs/commons" "^3.0.1"
707707

708-
"@sinonjs/samsam@^8.0.1":
708+
"@sinonjs/samsam@^8.0.3":
709709
version "8.0.3"
710710
resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-8.0.3.tgz#eb6ffaef421e1e27783cc9b52567de20cb28072d"
711711
integrity sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==
@@ -1415,6 +1415,11 @@ diff@^7.0.0:
14151415
resolved "https://registry.yarnpkg.com/diff/-/diff-7.0.0.tgz#3fb34d387cd76d803f6eebea67b921dab0182a9a"
14161416
integrity sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==
14171417

1418+
diff@^8.0.2:
1419+
version "8.0.3"
1420+
resolved "https://registry.yarnpkg.com/diff/-/diff-8.0.3.tgz#c7da3d9e0e8c283bb548681f8d7174653720c2d5"
1421+
integrity sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==
1422+
14181423
doctrine@^2.1.0:
14191424
version "2.1.0"
14201425
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
@@ -3747,15 +3752,15 @@ signal-exit@^4.0.1:
37473752
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04"
37483753
integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==
37493754

3750-
sinon@^21.0.0:
3751-
version "21.0.0"
3752-
resolved "https://registry.yarnpkg.com/sinon/-/sinon-21.0.0.tgz#dbda73abc7e6cb803fef3368cfbecbb5936e8a9e"
3753-
integrity sha512-TOgRcwFPbfGtpqvZw+hyqJDvqfapr1qUlOizROIk4bBLjlsjlB00Pg6wMFXNtJRpu+eCZuVOaLatG7M8105kAw==
3755+
sinon@^21.0.1:
3756+
version "21.0.1"
3757+
resolved "https://registry.yarnpkg.com/sinon/-/sinon-21.0.1.tgz#36b9126065a44906f7ba4a47b723b99315a8c356"
3758+
integrity sha512-Z0NVCW45W8Mg5oC/27/+fCqIHFnW8kpkFOq0j9XJIev4Ld0mKmERaZv5DMLAb9fGCevjKwaEeIQz5+MBXfZcDw==
37543759
dependencies:
37553760
"@sinonjs/commons" "^3.0.1"
3756-
"@sinonjs/fake-timers" "^13.0.5"
3757-
"@sinonjs/samsam" "^8.0.1"
3758-
diff "^7.0.0"
3761+
"@sinonjs/fake-timers" "^15.1.0"
3762+
"@sinonjs/samsam" "^8.0.3"
3763+
diff "^8.0.2"
37593764
supports-color "^7.2.0"
37603765

37613766
source-map@^0.6.1:

0 commit comments

Comments
 (0)