From 237c82598c4b42edac2fa722b92a7009c6a0a21f Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 14:31:32 -0500 Subject: [PATCH 01/27] init vitest unit test harness for @packages/driver --- package.json | 5 +- packages/driver/package.json | 6 +- packages/driver/tsconfig.json | 5 +- packages/driver/vitest.config.mjs | 13 + yarn.lock | 391 +++++++++++++++++++++++++++--- 5 files changed, 385 insertions(+), 35 deletions(-) create mode 100644 packages/driver/vitest.config.mjs diff --git a/package.json b/package.json index e2bc39dd78bb..68fb27eb102e 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,src,__snapshots__ --exclude cypress-tests.ts,*only.cy.js", "stop-only-all": "yarn stop-only --folder packages", "pretest": "yarn ensure-deps", - "test": "yarn lerna exec yarn test --scope=cypress --scope=@packages/{config,data-context,electron,errors,extension,https-proxy,launcher,net-stubbing,network,packherd-require,proxy,rewriter,scaffold-config,socket,v8-snapshot-require,telemetry} --scope=@tooling/{electron-mksnapshot,v8-snapshot}", + "test": "yarn lerna exec yarn test --scope=cypress --scope=@packages/{config,data-context,driver,electron,errors,extension,https-proxy,launcher,net-stubbing,network,packherd-require,proxy,rewriter,scaffold-config,socket,v8-snapshot-require,telemetry} --scope=@tooling/{electron-mksnapshot,v8-snapshot}", "test-debug": "lerna exec yarn test-debug --ignore=@packages/{driver,root,static,web-config}", "test-integration": "lerna exec yarn test-integration --ignore=@packages/{driver,root,static,web-config}", "test-mocha": "mocha --reporter spec scripts/spec.js", @@ -278,5 +278,6 @@ "devtools-protocol": "0.0.1346313", "sharp": "0.29.3", "vue-template-compiler": "2.6.12" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/packages/driver/package.json b/packages/driver/package.json index 041cfc593e44..cd4e7531377a 100644 --- a/packages/driver/package.json +++ b/packages/driver/package.json @@ -10,7 +10,9 @@ "cypress:run:inject-document-domain": "node ../../scripts/cypress run --config-file ./cypress.config-injectDocumentDomain.ts", "postinstall": "patch-package", "lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .", - "start": "node -e 'console.log(require(`chalk`).red(`\nError:\n\tRunning \\`yarn start\\` is no longer needed for driver/cypress tests.\n\tWe now automatically spawn the server in e2e.setupNodeEvents config.\n\tChanges to the server will be watched and reloaded automatically.`))'" + "start": "node -e 'console.log(require(`chalk`).red(`\nError:\n\tRunning \\`yarn start\\` is no longer needed for driver/cypress tests.\n\tWe now automatically spawn the server in e2e.setupNodeEvents config.\n\tChanges to the server will be watched and reloaded automatically.`))'", + "test": "vitest run", + "test:watch": "vitest watch" }, "dependencies": {}, "devDependencies": { @@ -58,6 +60,7 @@ "jimp": "0.22.12", "jquery": "3.7.1", "js-cookie": "3.0.5", + "jsdom": "^26.0.0", "json-stable-stringify": "1.0.1", "lodash": "^4.17.21", "md5": "2.3.0", @@ -81,6 +84,7 @@ "url-parse": "1.5.10", "vanilla-text-mask": "5.1.1", "vite": "5.2.11", + "vitest": "^2.1.8", "webpack": "^5.88.2", "zone.js": "0.9.0" }, diff --git a/packages/driver/tsconfig.json b/packages/driver/tsconfig.json index 33203e370049..25366cbce105 100644 --- a/packages/driver/tsconfig.json +++ b/packages/driver/tsconfig.json @@ -13,9 +13,10 @@ "noEmit": true, "outDir": "dist", "noErrorTruncation": true, - "types": [] + "types": ["vitest/globals"] }, "exclude": [ - "dist" + "dist", + "test" ] } diff --git a/packages/driver/vitest.config.mjs b/packages/driver/vitest.config.mjs new file mode 100644 index 000000000000..0549d3593ad6 --- /dev/null +++ b/packages/driver/vitest.config.mjs @@ -0,0 +1,13 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + include: ['test/unit/**/*.spec.ts'], + environment: 'jsdom', + exclude: ['**/__fixtures__/**/*'], + reporters: [ + 'default', + ['junit', { suiteName: 'Driver Unit Tests', outputFile: '/tmp/cypress/junit/driver-test-results.xml' }], + ], + }, +}) diff --git a/yarn.lock b/yarn.lock index 527ec23f98fe..494eed93fcc0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -144,6 +144,17 @@ resolved "https://registry.yarnpkg.com/@ardatan/fetch-event-source/-/fetch-event-source-2.0.2.tgz#734aa3eaa0da456453d24d8dc7c14d5e366a8d21" integrity sha512-mcpz/wJ7s50PJIVz4OQ1Yim3w/AAchtYtIg0QMWiMR2cZZoI9t23hRyqeumtD5EmyJu0fxtjmQ5WY8GI86V4rQ== +"@asamuzakjp/css-color@^2.8.2": + version "2.8.2" + resolved "https://registry.yarnpkg.com/@asamuzakjp/css-color/-/css-color-2.8.2.tgz#817e84b0cc9f426379f4b549836f32b670c43649" + integrity sha512-RtWv9jFN2/bLExuZgFFZ0I3pWWeezAHGgrmjqGGWclATl1aDe3yhCUaI0Ilkp6OCk9zX7+FjvDasEX8Q9Rxc5w== + dependencies: + "@csstools/css-calc" "^2.1.1" + "@csstools/css-color-parser" "^3.0.7" + "@csstools/css-parser-algorithms" "^3.0.4" + "@csstools/css-tokenizer" "^3.0.3" + lru-cache "^11.0.2" + "@aws-crypto/crc32@3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@aws-crypto/crc32/-/crc32-3.0.0.tgz#07300eca214409c33e3ff769cd5697b57fdd38fa" @@ -2606,6 +2617,34 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" +"@csstools/color-helpers@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@csstools/color-helpers/-/color-helpers-5.0.1.tgz#829f1c76f5800b79c51c709e2f36821b728e0e10" + integrity sha512-MKtmkA0BX87PKaO1NFRTFH+UnkgnmySQOvNxJubsadusqPEC2aJ9MOQiMceZJJ6oitUl/i0L6u0M1IrmAOmgBA== + +"@csstools/css-calc@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@csstools/css-calc/-/css-calc-2.1.1.tgz#a7dbc66627f5cf458d42aed14bda0d3860562383" + integrity sha512-rL7kaUnTkL9K+Cvo2pnCieqNpTKgQzy5f+N+5Iuko9HAoasP+xgprVh7KN/MaJVvVL1l0EzQq2MoqBHKSrDrag== + +"@csstools/css-color-parser@^3.0.7": + version "3.0.7" + resolved "https://registry.yarnpkg.com/@csstools/css-color-parser/-/css-color-parser-3.0.7.tgz#442d61d58e54ad258d52c309a787fceb33906484" + integrity sha512-nkMp2mTICw32uE5NN+EsJ4f5N+IGFeCFu4bGpiKgb2Pq/7J/MpyLBeQ5ry4KKtRFZaYs6sTmcMYrSRIyj5DFKA== + dependencies: + "@csstools/color-helpers" "^5.0.1" + "@csstools/css-calc" "^2.1.1" + +"@csstools/css-parser-algorithms@^3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.4.tgz#74426e93bd1c4dcab3e441f5cc7ba4fb35d94356" + integrity sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A== + +"@csstools/css-tokenizer@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@csstools/css-tokenizer/-/css-tokenizer-3.0.3.tgz#a5502c8539265fecbd873c1e395a890339f119c2" + integrity sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw== + "@cypress-design/color-constants@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@cypress-design/color-constants/-/color-constants-1.0.0.tgz#a8373c5eeeefc9b2040710b9159c96e6e2ac09b3" @@ -8888,6 +8927,16 @@ chai "^5.1.2" tinyrainbow "^1.2.0" +"@vitest/expect@2.1.8": + version "2.1.8" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-2.1.8.tgz#13fad0e8d5a0bf0feb675dcf1d1f1a36a1773bc1" + integrity sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw== + dependencies: + "@vitest/spy" "2.1.8" + "@vitest/utils" "2.1.8" + chai "^5.1.2" + tinyrainbow "^1.2.0" + "@vitest/mocker@2.1.4": version "2.1.4" resolved "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.4.tgz#0dc07edb9114f7f080a0181fbcdb16cd4a2d855d" @@ -8897,13 +8946,29 @@ estree-walker "^3.0.3" magic-string "^0.30.12" -"@vitest/pretty-format@2.1.4", "@vitest/pretty-format@^2.1.4": +"@vitest/mocker@2.1.8": + version "2.1.8" + resolved "https://registry.yarnpkg.com/@vitest/mocker/-/mocker-2.1.8.tgz#51dec42ac244e949d20009249e033e274e323f73" + integrity sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA== + dependencies: + "@vitest/spy" "2.1.8" + estree-walker "^3.0.3" + magic-string "^0.30.12" + +"@vitest/pretty-format@2.1.4": version "2.1.4" resolved "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.4.tgz#fc31993bdc1ef5a6c1a4aa6844e7ba55658a4f9f" integrity sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww== dependencies: tinyrainbow "^1.2.0" +"@vitest/pretty-format@2.1.8", "@vitest/pretty-format@^2.1.4", "@vitest/pretty-format@^2.1.8": + version "2.1.8" + resolved "https://registry.yarnpkg.com/@vitest/pretty-format/-/pretty-format-2.1.8.tgz#88f47726e5d0cf4ba873d50c135b02e4395e2bca" + integrity sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ== + dependencies: + tinyrainbow "^1.2.0" + "@vitest/runner@2.1.4": version "2.1.4" resolved "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.4.tgz#f9346500bdd0be1c926daaac5d683bae87ceda2c" @@ -8912,6 +8977,14 @@ "@vitest/utils" "2.1.4" pathe "^1.1.2" +"@vitest/runner@2.1.8": + version "2.1.8" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-2.1.8.tgz#b0e2dd29ca49c25e9323ea2a45a5125d8729759f" + integrity sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg== + dependencies: + "@vitest/utils" "2.1.8" + pathe "^1.1.2" + "@vitest/snapshot@2.1.4": version "2.1.4" resolved "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.4.tgz#ef8c3f605fbc23a32773256d37d3fdfd9b23d353" @@ -8921,6 +8994,15 @@ magic-string "^0.30.12" pathe "^1.1.2" +"@vitest/snapshot@2.1.8": + version "2.1.8" + resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-2.1.8.tgz#d5dc204f4b95dc8b5e468b455dfc99000047d2de" + integrity sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg== + dependencies: + "@vitest/pretty-format" "2.1.8" + magic-string "^0.30.12" + pathe "^1.1.2" + "@vitest/spy@2.1.4": version "2.1.4" resolved "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.4.tgz#4e90f9783437c5841a27c80f8fd84d7289a6100a" @@ -8928,6 +9010,13 @@ dependencies: tinyspy "^3.0.2" +"@vitest/spy@2.1.8": + version "2.1.8" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-2.1.8.tgz#bc41af3e1e6a41ae3b67e51f09724136b88fa447" + integrity sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg== + dependencies: + tinyspy "^3.0.2" + "@vitest/utils@2.1.4": version "2.1.4" resolved "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.4.tgz#6d67ac966647a21ce8bc497472ce230de3b64537" @@ -8937,6 +9026,15 @@ loupe "^3.1.2" tinyrainbow "^1.2.0" +"@vitest/utils@2.1.8": + version "2.1.8" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-2.1.8.tgz#f8ef85525f3362ebd37fd25d268745108d6ae388" + integrity sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA== + dependencies: + "@vitest/pretty-format" "2.1.8" + loupe "^3.1.2" + tinyrainbow "^1.2.0" + "@volar/language-core@2.2.4", "@volar/language-core@~2.2.4": version "2.2.4" resolved "https://registry.yarnpkg.com/@volar/language-core/-/language-core-2.2.4.tgz#50a9194732988610d6b0d8d8732a07235e6464c8" @@ -9802,12 +9900,10 @@ agent-base@^4.3.0: dependencies: es6-promisify "^5.0.0" -agent-base@^7.0.2, agent-base@^7.1.0, agent-base@^7.1.1: - version "7.1.1" - resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz#bdbded7dfb096b751a2a087eeeb9664725b2e317" - integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA== - dependencies: - debug "^4.3.4" +agent-base@^7.0.2, agent-base@^7.1.0, agent-base@^7.1.1, agent-base@^7.1.2: + version "7.1.3" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.3.tgz#29435eb821bc4194633a5b89e5bc4703bafc25a1" + integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== agentkeepalive@^4.2.1: version "4.2.1" @@ -13637,6 +13733,14 @@ csso@^5.0.5: dependencies: css-tree "~2.2.0" +cssstyle@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-4.2.1.tgz#5142782410fea95db66fb68147714a652a7c2381" + integrity sha512-9+vem03dMXG7gDmZ62uqmRiMRNtinIZ9ZyuF6BdxzfOD+FdN5hretzynkn0ReS2DO2GSw76RWHs0UmJPI2zUjw== + dependencies: + "@asamuzakjp/css-color" "^2.8.2" + rrweb-cssom "^0.8.0" + csstype@^2.6.8: version "2.6.17" resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.17.tgz#4cf30eb87e1d1a005d8b6510f95292413f6a1c0e" @@ -13732,6 +13836,14 @@ data-uri-to-buffer@^5.0.1: resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-5.0.1.tgz#db89a9e279c2ffe74f50637a59a32fb23b3e4d7c" integrity sha512-a9l6T1qqDogvvnw0nKlfZzqsyikEBZBClF39V3TFoKhDtGBqHu2HkuomJc02j5zft8zrUaXEuoicLeW54RkzPg== +data-urls@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-5.0.0.tgz#2f76906bce1824429ffecb6920f45a0b30f00dde" + integrity sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg== + dependencies: + whatwg-mimetype "^4.0.0" + whatwg-url "^14.0.0" + data-view-buffer@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.1.tgz#8ea6326efec17a2e42620696e671d7d5a8bc66b2" @@ -13904,6 +14016,11 @@ decamelize@^6.0.0: resolved "https://registry.npmjs.org/decamelize/-/decamelize-6.0.0.tgz#8cad4d916fde5c41a264a43d0ecc56fe3d31749e" integrity sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA== +decimal.js@^10.4.3: + version "10.4.3" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== + decode-uri-component@^0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" @@ -15246,10 +15363,10 @@ es-module-lexer@^0.9.0: resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== -es-module-lexer@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.3.0.tgz#6be9c9e0b4543a60cd166ff6f8b4e9dae0b0c16f" - integrity sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA== +es-module-lexer@^1.2.1, es-module-lexer@^1.5.4: + version "1.6.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.6.0.tgz#da49f587fd9e68ee2404fe4e256c0c7d3a81be21" + integrity sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ== es-object-atoms@^1.0.0: version "1.0.0" @@ -17102,7 +17219,7 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@^4.0.0, form-data@~4.0.0: +form-data@^4.0.0, form-data@^4.0.1, form-data@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.1.tgz#ba1076daaaa5bfd7e99c1a6cb02aa0a5cff90d48" integrity sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw== @@ -18635,6 +18752,13 @@ hpack.js@^2.1.6: readable-stream "^2.0.1" wbuf "^1.1.0" +html-encoding-sniffer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz#696df529a7cfd82446369dc5193e590a3735b448" + integrity sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ== + dependencies: + whatwg-encoding "^3.1.1" + html-entities@^2.3.2, html-entities@^2.4.0: version "2.5.2" resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.5.2.tgz#201a3cf95d3a15be7099521620d19dfb4f65359f" @@ -18891,12 +19015,12 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -https-proxy-agent@^7.0.0, https-proxy-agent@^7.0.1, https-proxy-agent@^7.0.2, https-proxy-agent@^7.0.3, https-proxy-agent@^7.0.5: - version "7.0.5" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz#9e8b5013873299e11fab6fd548405da2d6c602b2" - integrity sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw== +https-proxy-agent@^7.0.0, https-proxy-agent@^7.0.1, https-proxy-agent@^7.0.2, https-proxy-agent@^7.0.3, https-proxy-agent@^7.0.5, https-proxy-agent@^7.0.6: + version "7.0.6" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz#da8dfeac7da130b05c2ba4b59c9b6cd66611a6b9" + integrity sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw== dependencies: - agent-base "^7.0.2" + agent-base "^7.1.2" debug "4" human-interval@1.0.0: @@ -18953,7 +19077,7 @@ iconv-lite@0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -iconv-lite@^0.6.2: +iconv-lite@0.6.3, iconv-lite@^0.6.2: version "0.6.3" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== @@ -19824,6 +19948,11 @@ is-port-reachable@4.0.0: resolved "https://registry.yarnpkg.com/is-port-reachable/-/is-port-reachable-4.0.0.tgz#dac044091ef15319c8ab2f34604d8794181f8c2d" integrity sha512-9UoipoxYmSk6Xy7QFgRv2HDyaysmgSG75TFQs6S+3pDM7ZhKTF/bskZV+0UlABHzKjNVhPjYCLfeZUEg1wXxig== +is-potential-custom-element-name@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== + is-promise@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-4.0.0.tgz#42ff9f84206c1991d26debf520dd5c01042dd2f3" @@ -20349,6 +20478,33 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +jsdom@^26.0.0: + version "26.0.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-26.0.0.tgz#446dd1ad8cfc50df7e714e58f1f972c1763b354c" + integrity sha512-BZYDGVAIriBWTpIxYzrXjv3E/4u8+/pSG5bQdIYCbNCGOvsPkDQfTVLAIXAf9ETdCpduCVTkDe2NNZ8NIwUVzw== + dependencies: + cssstyle "^4.2.1" + data-urls "^5.0.0" + decimal.js "^10.4.3" + form-data "^4.0.1" + html-encoding-sniffer "^4.0.0" + http-proxy-agent "^7.0.2" + https-proxy-agent "^7.0.6" + is-potential-custom-element-name "^1.0.1" + nwsapi "^2.2.16" + parse5 "^7.2.1" + rrweb-cssom "^0.8.0" + saxes "^6.0.0" + symbol-tree "^3.2.4" + tough-cookie "^5.0.0" + w3c-xmlserializer "^5.0.0" + webidl-conversions "^7.0.0" + whatwg-encoding "^3.1.1" + whatwg-mimetype "^4.0.0" + whatwg-url "^14.1.0" + ws "^8.18.0" + xml-name-validator "^5.0.0" + jsesc@2.5.2, jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -21734,6 +21890,11 @@ lru-cache@^10.0.0, lru-cache@^10.0.1, lru-cache@^10.2.0, lru-cache@^10.2.2: resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== +lru-cache@^11.0.2: + version "11.0.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.0.2.tgz#fbd8e7cf8211f5e7e5d91905c415a3f55755ca39" + integrity sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA== + lru-cache@^4.0.0, lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" @@ -22614,7 +22775,7 @@ mobx@6.13.5: resolved "https://registry.npmjs.org/mobx/-/mobx-6.13.5.tgz#957d9df88c7f8b4baa7c6f8bdcb6d68b432a6ed5" integrity sha512-/HTWzW2s8J1Gqt+WmUj5Y0mddZk+LInejADc79NJadrWla3rHzmRHki/mnEUH1AvOmbNTZ1BRbKxr8DSgfdjMA== -"mocha-7.0.1@npm:mocha@7.0.1", mocha@7.0.1: +"mocha-7.0.1@npm:mocha@7.0.1": version "7.0.1" resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.0.1.tgz#276186d35a4852f6249808c6dd4a1376cbf6c6ce" integrity sha512-9eWmWTdHLXh72rGrdZjNbG3aa1/3NRPpul1z0D979QpEnFdCG0Q5tv834N+94QEN2cysfV72YocQ3fn87s70fg== @@ -22731,6 +22892,36 @@ mocha@6.2.2: yargs-parser "13.1.1" yargs-unparser "1.6.0" +mocha@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.0.1.tgz#276186d35a4852f6249808c6dd4a1376cbf6c6ce" + integrity sha512-9eWmWTdHLXh72rGrdZjNbG3aa1/3NRPpul1z0D979QpEnFdCG0Q5tv834N+94QEN2cysfV72YocQ3fn87s70fg== + dependencies: + ansi-colors "3.2.3" + browser-stdout "1.3.1" + chokidar "3.3.0" + debug "3.2.6" + diff "3.5.0" + escape-string-regexp "1.0.5" + find-up "3.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.13.1" + log-symbols "2.2.0" + minimatch "3.0.4" + mkdirp "0.5.1" + ms "2.1.1" + node-environment-flags "1.0.6" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "13.3.0" + yargs-parser "13.1.1" + yargs-unparser "1.6.0" + mocha@7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.1.0.tgz#c784f579ad0904d29229ad6cb1e2514e4db7d249" @@ -24071,6 +24262,11 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= +nwsapi@^2.2.16: + version "2.2.16" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.16.tgz#177760bba02c351df1d2644e220c31dfec8cdb43" + integrity sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ== + nx@19.8.6, "nx@>=17.1.2 < 20": version "19.8.6" resolved "https://registry.yarnpkg.com/nx/-/nx-19.8.6.tgz#979a8b6183596a69fcaa975aeb74d01c37294309" @@ -25078,6 +25274,13 @@ parse5@^6.0.1: resolved "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== +parse5@^7.2.1: + version "7.2.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.2.1.tgz#8928f55915e6125f430cc44309765bf17556a33a" + integrity sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ== + dependencies: + entities "^4.5.0" + parseqs@0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.6.tgz#8e4bb5a19d1cdc844a08ac974d34e273afa670d5" @@ -26116,10 +26319,10 @@ punycode@^1.2.4, punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== +punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.0, punycode@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== pupa@^2.0.1: version "2.1.1" @@ -27484,6 +27687,11 @@ rollup@^4.13.0, rollup@^4.20.0, rollup@^4.23.0, rollup@^4.24.4: "@rollup/rollup-win32-x64-msvc" "4.27.4" fsevents "~2.3.2" +rrweb-cssom@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz#3021d1b4352fbf3b614aaeed0bc0d5739abe0bc2" + integrity sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw== + run-applescript@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/run-applescript/-/run-applescript-3.2.0.tgz#73fb34ce85d3de8076d511ea767c30d4fdfc918b" @@ -27618,6 +27826,13 @@ sax@>=0.6.0, sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== +saxes@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" + integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== + dependencies: + xmlchars "^2.2.0" + scheduler@^0.19.1: version "0.19.1" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" @@ -29118,10 +29333,10 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= -std-env@^3.7.0: - version "3.7.0" - resolved "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz#c9f7386ced6ecf13360b6c6c55b8aaa4ef7481d2" - integrity sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg== +std-env@^3.7.0, std-env@^3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.8.0.tgz#b56ffc1baf1a29dcc80a3bdf11d7fca7c315e7d5" + integrity sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w== stdio-mock@^1.1.0: version "1.1.0" @@ -29277,7 +29492,7 @@ string-template@~0.2.1: resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" integrity sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0= -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -29303,6 +29518,15 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" @@ -29413,7 +29637,7 @@ stringify-object@^3.0.0, stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -29434,6 +29658,13 @@ strip-ansi@5.2.0, strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -29773,6 +30004,11 @@ symbol-observable@^1.0.4, symbol-observable@^1.1.0: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== +symbol-tree@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== + sync-fetch@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/sync-fetch/-/sync-fetch-0.3.0.tgz#77246da949389310ad978ab26790bb05f88d1335" @@ -30458,6 +30694,13 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" +tr46@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-5.0.0.tgz#3b46d583613ec7283020d79019f1335723801cec" + integrity sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g== + dependencies: + punycode "^2.3.1" + tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -31708,6 +31951,17 @@ vite-node@2.1.4: pathe "^1.1.2" vite "^5.0.0" +vite-node@2.1.8: + version "2.1.8" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-2.1.8.tgz#9495ca17652f6f7f95ca7c4b568a235e0c8dbac5" + integrity sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg== + dependencies: + cac "^6.7.14" + debug "^4.3.7" + es-module-lexer "^1.5.4" + pathe "^1.1.2" + vite "^5.0.0" + vite-plugin-inspect@0.8.4: version "0.8.4" resolved "https://registry.yarnpkg.com/vite-plugin-inspect/-/vite-plugin-inspect-0.8.4.tgz#1fcdf6703164d651db3f13c8c6610e1ced5108e1" @@ -31826,6 +32080,32 @@ vitest@2.1.4: vite-node "2.1.4" why-is-node-running "^2.3.0" +vitest@^2.1.8: + version "2.1.8" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-2.1.8.tgz#2e6a00bc24833574d535c96d6602fb64163092fa" + integrity sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ== + dependencies: + "@vitest/expect" "2.1.8" + "@vitest/mocker" "2.1.8" + "@vitest/pretty-format" "^2.1.8" + "@vitest/runner" "2.1.8" + "@vitest/snapshot" "2.1.8" + "@vitest/spy" "2.1.8" + "@vitest/utils" "2.1.8" + chai "^5.1.2" + debug "^4.3.7" + expect-type "^1.1.0" + magic-string "^0.30.12" + pathe "^1.1.2" + std-env "^3.8.0" + tinybench "^2.9.0" + tinyexec "^0.3.1" + tinypool "^1.0.1" + tinyrainbow "^1.2.0" + vite "^5.0.0" + vite-node "2.1.8" + why-is-node-running "^2.3.0" + vm-browserify@^1.0.1, vm-browserify@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" @@ -31923,6 +32203,13 @@ vuex@^4.0.0: resolved "https://registry.yarnpkg.com/vuex/-/vuex-4.0.0.tgz#ac877aa76a9c45368c979471e461b520d38e6cf5" integrity sha512-56VPujlHscP5q/e7Jlpqc40sja4vOhC4uJD1llBCWolVI8ND4+VzisDVkUMl+z5y0MpIImW6HjhNc+ZvuizgOw== +w3c-xmlserializer@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz#f925ba26855158594d907313cedd1476c5967f6c" + integrity sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA== + dependencies: + xml-name-validator "^5.0.0" + wait-port@1.1.0, wait-port@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/wait-port/-/wait-port-1.1.0.tgz#e5d64ee071118d985e2b658ae7ad32b2ce29b6b5" @@ -32019,6 +32306,11 @@ webidl-conversions@^4.0.2: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== +webidl-conversions@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" + integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== + "webpack-4@npm:webpack@^4": version "4.46.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.46.0.tgz#bf9b4404ea20a073605e0a011d188d77cb6ad542" @@ -32275,11 +32567,31 @@ websocket-extensions@>=0.1.1: resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== +whatwg-encoding@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz#d0f4ef769905d426e1688f3e34381a99b60b76e5" + integrity sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ== + dependencies: + iconv-lite "0.6.3" + whatwg-fetch@>=0.10.0, whatwg-fetch@^3.4.1: version "3.6.2" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== +whatwg-mimetype@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz#bc1bf94a985dc50388d54a9258ac405c3ca2fc0a" + integrity sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg== + +whatwg-url@^14.0.0, whatwg-url@^14.1.0: + version "14.1.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-14.1.0.tgz#fffebec86cc8e6c2a657e50dc606207b870f0ab3" + integrity sha512-jlf/foYIKywAt3x/XWKZ/3rz8OSJPiWktjmk891alJUEjiVxKX9LEO92qH3hv4aJ0mN3MWPvGMCy8jQi95xK4w== + dependencies: + tr46 "^5.0.0" + webidl-conversions "^7.0.0" + whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -32468,7 +32780,7 @@ workerpool@6.2.0: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -32511,6 +32823,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -32654,6 +32975,11 @@ xhr@^2.0.1: parse-headers "^2.0.0" xtend "^4.0.0" +xml-name-validator@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-5.0.0.tgz#82be9b957f7afdacf961e5980f1bf227c0bf7673" + integrity sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg== + xml-parse-from-string@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz#a9029e929d3dbcded169f3c6e28238d95a5d5a28" @@ -32690,6 +33016,11 @@ xmlbuilder@~11.0.0: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== +xmlchars@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== + xmlhttprequest-ssl@~1.6.2: version "1.6.3" resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.6.3.tgz#03b713873b01659dfa2c1c5d056065b27ddc2de6" From 610640056222de63cb79b9baa3f627f5a5c46263 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 14:36:03 -0500 Subject: [PATCH 02/27] unit tests with stack examples --- .../__fixtures__/spec_stackframes.json | 37 ++++++++++ .../test/unit/cypress/stack_utils.spec.ts | 68 +++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 packages/driver/test/unit/cypress/__fixtures__/spec_stackframes.json create mode 100644 packages/driver/test/unit/cypress/stack_utils.spec.ts diff --git a/packages/driver/test/unit/cypress/__fixtures__/spec_stackframes.json b/packages/driver/test/unit/cypress/__fixtures__/spec_stackframes.json new file mode 100644 index 000000000000..351986089050 --- /dev/null +++ b/packages/driver/test/unit/cypress/__fixtures__/spec_stackframes.json @@ -0,0 +1,37 @@ +{ + "invocationFile": "cypress/tests/some_spec.cy.ts", + "line": 80, + "column": 12, + "scenarios": [ + { + "browser": "chrome", + "build": "dev", + "specFrame": "http://localhost:3000/__cypress/tests?p=cypress/tests/some_spec.cy.ts", + "stack": "Error\n at eval (eval at getInvocationDetails (cypress:///../driver/src/cypress/stack_utils.ts), :1:1)\n at Object.getInvocationDetails (cypress:///../driver/src/cypress/stack_utils.ts:98:32)\n at Suite.addSuite (cypress:///../driver/src/cypress/mocha.ts:488:86)\n at Suite.create (cypress:///../driver/node_modules/mocha/lib/suite.js:33:10)\n at Object.create (cypress:///../driver/node_modules/mocha/lib/interfaces/common.js:123:27)\n at context.describe.context.context (cypress:///../driver/node_modules/mocha/lib/interfaces/bdd.js:41:27)\n at createRunnable (cypress:///../driver/src/cypress/mocha.ts:126:31)\n at eval (cypress:///../driver/src/cypress/mocha.ts:187:14)\n at eval (http://localhost:3000/__cypress/tests?p=cypress/tests/some_spec.cy.ts:80:12)\n at eval (http://localhost:3000/__cypress/tests?p=some/other/file.ts:212:3)" + }, + { + "browser": "chrome", + "build": "binary", + "specFrame": "http://localhost:3000/__cypress/tests?p=cypress/tests/some_spec.cy.ts", + "stack": "Error\n at eval (eval at getInvocationDetails (http://localhost:3000/__cypress/runner/cypress_runner.js:97352:7), :1:1)\n at Object.getInvocationDetails (http://localhost:3000/__cypress/runner/cypress_runner.js:97352:7)\n at Suite.addTest (http://localhost:3000/__cypress/runner/cypress_runner.js:144608:85)\n at context.it.context.specify (http://localhost:3000/__cypress/runner/cypress_runner.js:159706:13)\n at createRunnable (http://localhost:3000/__cypress/runner/cypress_runner.js:144272:31)\n at http://localhost:3000/__cypress/runner/cypress_runner.js:144333:14\n at Suite.eval (http://localhost:3000/__cypress/tests?p=cypress/tests/some_spec.cy.ts:80:12)\n at Object.create (http://localhost:3000/__cypress/runner/cypress_runner.js:159940:19)\n at context.describe.context.context (http://localhost:3000/__cypress/runner/cypress_runner.js:159659:27)\n at createRunnable (http://localhost:3000/__cypress/runner/cypress_runner.js:144272:31)" + }, + { + "browser": "chrome", + "build": "injectDocumentDomain", + "specFrame": "http://localhost:3000/__cypress/tests?p=cypress/tests/some_spec.cy.ts", + "stack": "Error\nat eval (http://localhost:3000/__cypress/tests?p=cypress/tests/some_spec.cy.ts:80:12)\nat eval (http://localhost:3000/__cypress/tests?p=some/other/file.ts:212:3)\nat eval (http://localhost:3000/__cypress/tests?p=some/other/file.ts:214:12)\nat eval ()" + }, + { + "browser": "firefox", + "build": "binary", + "specFrame": "http://localhost:3000/__cypress/tests?p=cypress/tests/some_spec.cy.ts", + "stack": "getInvocationDetails@http://localhost:3000/__cypress/runner/cypress_runner.js:97344:17\n__webpack_modules__ { + return { + default: { + getSourcePosition: vi.fn(), + }, + } +}) + +describe('stack_utils', () => { + beforeEach(() => { + // @ts-expect-error + global.Cypress = { + config: vi.fn(), + } + + vi.resetAllMocks() + }) + + describe('getInvocationDetails', () => { + const { line, column, scenarios } = stackFrameFixture + + const projectRoot = '/foo/bar' + + let stack: string + + class MockError { + get stack () { + return stack + } + } + const config = () => projectRoot + + for (const scenario of scenarios) { + const { browser, build, specFrame, stack: scenarioStack } = scenario + + describe(`${browser}:${build}`, () => { + beforeEach(() => { + stack = scenarioStack + }) + + it('calls getSourcePosition with the correct file, line, and column', () => { + stack_utils.getInvocationDetails( + { Error: MockError, Cypress: {} }, + config, + ) + + // getSourcePosition is not called directly from getInvocationDetails, but via: + // - getSourceDetailsForFirstLine + // - getSourceDetailsForLine + expect(source_map_utils.getSourcePosition).toHaveBeenCalledWith(specFrame, expect.objectContaining({ + column, + line, + file: specFrame, + })) + }) + }) + } + }) +}) From 877d8b206edacb3055b3130a6b086d1672ff80ce Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 14:36:23 -0500 Subject: [PATCH 03/27] drop lines until __cypress/tests rather than just __cypress --- packages/driver/src/cypress/stack_utils.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/driver/src/cypress/stack_utils.ts b/packages/driver/src/cypress/stack_utils.ts index c28049d262bc..4c7ea36554e2 100644 --- a/packages/driver/src/cypress/stack_utils.ts +++ b/packages/driver/src/cypress/stack_utils.ts @@ -108,9 +108,16 @@ const stackWithUserInvocationStackSpliced = (err, userInvocationStack): StackAnd } } -type InvocationDetails = MessageLineDetail | {} +type InvocationDetails = { + absoluteFile?: string + column?: number + line?: number + originalFile?: string + relativeFile?: string +} -const getInvocationDetails = (specWindow, config) => { +// used to determine codeframes for hook/test/etc definitions rather than command invocations +const getInvocationDetails = (specWindow, config): InvocationDetails | undefined => { if (specWindow.Error) { let stack = (new specWindow.Error()).stack @@ -120,7 +127,11 @@ const getInvocationDetails = (specWindow, config) => { // firefox and chrome throw stacks that include lines from cypress // So we drop the lines until we get to the spec stackframe (includes __cypress) if (specWindow.Cypress) { - stack = stackWithLinesDroppedFromMarker(stack, '__cypress', true) + // The stack includes frames internal to cypress, after the spec stackframe. In order + // to determine the invocation details, the stack needs to be parsed and trimmed. + + // in Chrome and Firefox, the spec stackframe includes the pattern, '__cypress/tests'. + stack = stackWithLinesDroppedFromMarker(stack, '__cypress/tests', true) } const details: InvocationDetails = getSourceDetailsForFirstLine(stack, config('projectRoot')) || {}; From 84519d6afac5046bb436d5f25d16b7ac2345a1bc Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 14:56:15 -0500 Subject: [PATCH 04/27] changelog --- cli/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 7443b288e350..c5e28da17915 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -55,6 +55,7 @@ in this [GitHub issue](https://github.com/cypress-io/cypress/issues/30447). Addr - Fixed a visibility issue for elements with `textContent` but without a width or height. Fixed in [#29688](https://github.com/cypress-io/cypress/pull/29688). Fixes [#29687](https://github.com/cypress-io/cypress/issues/29687). - Elements whose parent elements has `overflow: clip` and no height/width will now correctly show as hidden. Fixed in [#29778](https://github.com/cypress-io/cypress/pull/29778). Fixes [#23852](https://github.com/cypress-io/cypress/issues/23852). - The CSS pseudo-class `:dir()` is now supported when testing in Electron. Addresses [#29766](https://github.com/cypress-io/cypress/issues/29766). +- The Open in IDE button next to blocks and hooks in the runner UI will now properly open the IDE. This bug was introduced in a prerelease version of Cypress 14.0.0. Fixed in [#30859](https://github.com/cypress-io/cypress/pull/30859). **Misc:** From d99c450204703f2f57abf7ba29a2ab5528397c38 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 15:03:39 -0500 Subject: [PATCH 05/27] changelog --- cli/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index c5e28da17915..5db73f6fe4bf 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -55,7 +55,7 @@ in this [GitHub issue](https://github.com/cypress-io/cypress/issues/30447). Addr - Fixed a visibility issue for elements with `textContent` but without a width or height. Fixed in [#29688](https://github.com/cypress-io/cypress/pull/29688). Fixes [#29687](https://github.com/cypress-io/cypress/issues/29687). - Elements whose parent elements has `overflow: clip` and no height/width will now correctly show as hidden. Fixed in [#29778](https://github.com/cypress-io/cypress/pull/29778). Fixes [#23852](https://github.com/cypress-io/cypress/issues/23852). - The CSS pseudo-class `:dir()` is now supported when testing in Electron. Addresses [#29766](https://github.com/cypress-io/cypress/issues/29766). -- The Open in IDE button next to blocks and hooks in the runner UI will now properly open the IDE. This bug was introduced in a prerelease version of Cypress 14.0.0. Fixed in [#30859](https://github.com/cypress-io/cypress/pull/30859). +- The Open in IDE button next to blocks and hooks in the runner UI will now properly open the IDE. This bug was introduced in a prerelease version of Cypress 14.0.0. Fixed in [#30859](https://github.com/cypress-io/cypress/pull/30859). Fixes [#30847](https://github.com/cypress-io/cypress/issues/30847). **Misc:** From f137526f635bea363103b86f1c3517d1206986c7 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 15:08:17 -0500 Subject: [PATCH 06/27] remove vitest globals (unnecessary) from driver tsconfig --- packages/driver/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/driver/tsconfig.json b/packages/driver/tsconfig.json index 25366cbce105..ae965bc45f77 100644 --- a/packages/driver/tsconfig.json +++ b/packages/driver/tsconfig.json @@ -13,7 +13,8 @@ "noEmit": true, "outDir": "dist", "noErrorTruncation": true, - "types": ["vitest/globals"] + "types": [], + "resolveJsonModule": true }, "exclude": [ "dist", From 6cedebc326415e6a1745639635c63c0ddff7a258 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 15:49:40 -0500 Subject: [PATCH 07/27] bump the number of junit reports expected from the unit tests job --- .circleci/workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index b69469b746be..65a1053dde8b 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -1678,7 +1678,7 @@ jobs: # run type checking for each individual package - run: yarn lerna run types - verify-mocha-results: - expectedResultCount: 19 + expectedResultCount: 20 - store_test_results: path: /tmp/cypress # CLI tests generate HTML files with sample CLI command output From c6c9d2868143fe6fda54576701a6180b4a696692 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 15:49:55 -0500 Subject: [PATCH 08/27] fix ts-check error in scroll.ts --- packages/driver/src/cy/commands/actions/scroll.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/driver/src/cy/commands/actions/scroll.ts b/packages/driver/src/cy/commands/actions/scroll.ts index 04b7f31fa958..78404fa41a69 100644 --- a/packages/driver/src/cy/commands/actions/scroll.ts +++ b/packages/driver/src/cy/commands/actions/scroll.ts @@ -128,6 +128,7 @@ export default (Commands, Cypress, cy, state) => { const scrollIntoView = () => { return new Promise((resolve, reject) => { // scroll our axes + // @ts-expect-error - scrollTo does not define a 'done()' key on its config object. return $(options.$parent).scrollTo(options.$el, { axis: options.axis, easing: options.easing, From edd10e700770d90c5cd774da2d2e1d4d353ba138 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 15:50:13 -0500 Subject: [PATCH 09/27] fix type definition for getInvocationDetails --- packages/driver/src/cypress/stack_utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/driver/src/cypress/stack_utils.ts b/packages/driver/src/cypress/stack_utils.ts index 4c7ea36554e2..d08775403c52 100644 --- a/packages/driver/src/cypress/stack_utils.ts +++ b/packages/driver/src/cypress/stack_utils.ts @@ -114,6 +114,7 @@ type InvocationDetails = { line?: number originalFile?: string relativeFile?: string + stack: string } // used to determine codeframes for hook/test/etc definitions rather than command invocations @@ -134,7 +135,7 @@ const getInvocationDetails = (specWindow, config): InvocationDetails | undefined stack = stackWithLinesDroppedFromMarker(stack, '__cypress/tests', true) } - const details: InvocationDetails = getSourceDetailsForFirstLine(stack, config('projectRoot')) || {}; + const details: Omit = getSourceDetailsForFirstLine(stack, config('projectRoot')) || {}; (details as any).stack = stack From 21a757eb9d898fb732febabc200907457974060c Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 15:53:54 -0500 Subject: [PATCH 10/27] rm packageManager key on package.json --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 68fb27eb102e..2cb33f4df273 100644 --- a/package.json +++ b/package.json @@ -278,6 +278,5 @@ "devtools-protocol": "0.0.1346313", "sharp": "0.29.3", "vue-template-compiler": "2.6.12" - }, - "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" + } } From 921d67f238c5f0524f757fbe7d9cca971e8d701b Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 16:09:53 -0500 Subject: [PATCH 11/27] remove junit reporter, as script that verifies result does not recognize it as valid --- packages/driver/vitest.config.mjs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/driver/vitest.config.mjs b/packages/driver/vitest.config.mjs index 0549d3593ad6..b853a34faf28 100644 --- a/packages/driver/vitest.config.mjs +++ b/packages/driver/vitest.config.mjs @@ -5,9 +5,5 @@ export default defineConfig({ include: ['test/unit/**/*.spec.ts'], environment: 'jsdom', exclude: ['**/__fixtures__/**/*'], - reporters: [ - 'default', - ['junit', { suiteName: 'Driver Unit Tests', outputFile: '/tmp/cypress/junit/driver-test-results.xml' }], - ], }, }) From f4060805cf30119c0dadb8ee4611fd3277a2c36c Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 16:10:23 -0500 Subject: [PATCH 12/27] change @ts-expect-error to @ts-ignore for .scroll, as this ts check is apparently flaky --- packages/driver/src/cy/commands/actions/scroll.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/driver/src/cy/commands/actions/scroll.ts b/packages/driver/src/cy/commands/actions/scroll.ts index 78404fa41a69..e80b612c137c 100644 --- a/packages/driver/src/cy/commands/actions/scroll.ts +++ b/packages/driver/src/cy/commands/actions/scroll.ts @@ -128,7 +128,7 @@ export default (Commands, Cypress, cy, state) => { const scrollIntoView = () => { return new Promise((resolve, reject) => { // scroll our axes - // @ts-expect-error - scrollTo does not define a 'done()' key on its config object. + // @ts-ignore - scrollTo does not define a 'done()' key on its config object. return $(options.$parent).scrollTo(options.$el, { axis: options.axis, easing: options.easing, From da40a47c90019e3798576ec906771e35588047bf Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 16:24:19 -0500 Subject: [PATCH 13/27] set expected mocha result back to 19 --- .circleci/workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 65a1053dde8b..b69469b746be 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -1678,7 +1678,7 @@ jobs: # run type checking for each individual package - run: yarn lerna run types - verify-mocha-results: - expectedResultCount: 20 + expectedResultCount: 19 - store_test_results: path: /tmp/cypress # CLI tests generate HTML files with sample CLI command output From e06a2c499631f1adfc7013b2755bc3c8b2c5b315 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Fri, 10 Jan 2025 16:26:03 -0500 Subject: [PATCH 14/27] add ct style stacks for cy in cy ct tests --- packages/driver/src/cypress/stack_utils.ts | 9 +++++++-- .../test/unit/cypress/__fixtures__/spec_stackframes.json | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/driver/src/cypress/stack_utils.ts b/packages/driver/src/cypress/stack_utils.ts index d08775403c52..2dc557d370dc 100644 --- a/packages/driver/src/cypress/stack_utils.ts +++ b/packages/driver/src/cypress/stack_utils.ts @@ -131,8 +131,13 @@ const getInvocationDetails = (specWindow, config): InvocationDetails | undefined // The stack includes frames internal to cypress, after the spec stackframe. In order // to determine the invocation details, the stack needs to be parsed and trimmed. - // in Chrome and Firefox, the spec stackframe includes the pattern, '__cypress/tests'. - stack = stackWithLinesDroppedFromMarker(stack, '__cypress/tests', true) + // in Chrome and Firefox in E2E contexts, the spec stackframe includes the pattern, '__cypress/tests'. + if (stack.includes('__cypress/tests')) { + stack = stackWithLinesDroppedFromMarker(stack, '__cypress/tests', true) + } else { + // CT error contexts include the `__cypress` marker but not the `/tests` portion + stack = stackWithLinesDroppedFromMarker(stack, '__cypress', true) + } } const details: Omit = getSourceDetailsForFirstLine(stack, config('projectRoot')) || {}; diff --git a/packages/driver/test/unit/cypress/__fixtures__/spec_stackframes.json b/packages/driver/test/unit/cypress/__fixtures__/spec_stackframes.json index 351986089050..fa9f958c3acd 100644 --- a/packages/driver/test/unit/cypress/__fixtures__/spec_stackframes.json +++ b/packages/driver/test/unit/cypress/__fixtures__/spec_stackframes.json @@ -32,6 +32,12 @@ "build": "dev", "specFrame": "http://localhost:3000/__cypress/tests?p=cypress/tests/some_spec.cy.ts", "stack": "getInvocationDetails@cypress:///../driver/src/cypress/stack_utils.ts:100:17\npatchSuiteAddTest/Suite.prototype.addTest@cypress:///../driver/src/cypress/mocha.ts:462:85\nbddInterface/ [as beforeEach] (cypress:///../driver/src/cypress/mocha.ts:546:23)\n at beforeEach (cypress:///../driver/node_modules/mocha/lib/interfaces/common.js:73:17)\n at Context. (http://localhost:4455/__cypress/src/@fs/private/var/folders/g4/15yxjhzs4bd01m_s6cscgxfw0000gq/T/cy-projects/runner-ct-specs/cypress/test.cy.ts:80:12)\n at __stackReplacementMarker (cypress:///../driver/src/cypress/cy.ts:85:13)\n at runnable.fn (cypress:///../driver/src/cypress/cy.ts:872:19)\n at callFn (cypress:///../driver/node_modules/mocha/lib/runnable.js:394:21)\n at Runnable.run (cypress:///../driver/node_modules/mocha/lib/runnable.js:381:7)" } ] } \ No newline at end of file From 6d580b0740ff30949ef34ff651ae0051baa44c2b Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 09:13:56 -0500 Subject: [PATCH 15/27] re-enable junit reporter, update mocha result verification to be more lenient about the order of xml fields --- packages/driver/vitest.config.mjs | 4 ++++ scripts/verify-mocha-results.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/driver/vitest.config.mjs b/packages/driver/vitest.config.mjs index b853a34faf28..0549d3593ad6 100644 --- a/packages/driver/vitest.config.mjs +++ b/packages/driver/vitest.config.mjs @@ -5,5 +5,9 @@ export default defineConfig({ include: ['test/unit/**/*.spec.ts'], environment: 'jsdom', exclude: ['**/__fixtures__/**/*'], + reporters: [ + 'default', + ['junit', { suiteName: 'Driver Unit Tests', outputFile: '/tmp/cypress/junit/driver-test-results.xml' }], + ], }, }) diff --git a/scripts/verify-mocha-results.js b/scripts/verify-mocha-results.js index 35be807e5a2d..f2e3a0cdfb74 100644 --- a/scripts/verify-mocha-results.js +++ b/scripts/verify-mocha-results.js @@ -11,13 +11,17 @@ const la = require('lazy-ass') const path = require('path') const { readCircleEnv } = require('./circle-env') +// mocha regex const RESULT_REGEX = // +// vitest regex +const VRESULT_REGEX = // + const REPORTS_PATH = '/tmp/cypress/junit' const expectedResultCount = Number(process.argv[process.argv.length - 1]) const parseResult = (xml) => { - const [name, time, tests, failures, skipped] = RESULT_REGEX.exec(xml).slice(1) + const [name, time, tests, failures, skipped] = (RESULT_REGEX.exec(xml) ?? VRESULT_REGEX.exec(xml)).slice(1) return { name, time, tests: Number(tests), failures: Number(failures), skipped: Number(skipped || 0), From b3018b4e04bc42bae99ec5360be879264db9e0d1 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 09:15:37 -0500 Subject: [PATCH 16/27] persist binaries for this branch --- .circleci/workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index b69469b746be..420d56cfcaa3 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -153,7 +153,7 @@ commands: name: Set environment variable to determine whether or not to persist artifacts command: | echo "Setting SHOULD_PERSIST_ARTIFACTS variable" - echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "chore/update_vue_test_utils" ]]; then + echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "chore/update_vue_test_utils" && "$CIRCLE_BRANCH" != cacie/fix-hook-test-stack-analysis ]]; then export SHOULD_PERSIST_ARTIFACTS=true fi' >> "$BASH_ENV" # You must run `setup_should_persist_artifacts` command and be using bash before running this command From 6c2ded87f1069303feed5dc54d3d8e09b83305f8 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 09:58:40 -0500 Subject: [PATCH 17/27] expect 20 junit reports again --- .circleci/workflows.yml | 2 +- system-tests/lib/serverStub.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 420d56cfcaa3..e78e185ad63f 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -1678,7 +1678,7 @@ jobs: # run type checking for each individual package - run: yarn lerna run types - verify-mocha-results: - expectedResultCount: 19 + expectedResultCount: 20 - store_test_results: path: /tmp/cypress # CLI tests generate HTML files with sample CLI command output diff --git a/system-tests/lib/serverStub.ts b/system-tests/lib/serverStub.ts index cf40802af117..7d069746317b 100644 --- a/system-tests/lib/serverStub.ts +++ b/system-tests/lib/serverStub.ts @@ -269,7 +269,7 @@ export const routeHandlers: Record = { }, } -export const createRoutes = (props: DeepPartial) => { +export const createRoutes = (props: DeepPartial = {}) => { return _.values(_.merge(_.cloneDeep(routeHandlers), props)) } From 30d0f456df207517fdbc5decf9976fe6524b7fa1 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 10:19:14 -0500 Subject: [PATCH 18/27] fix mocha v vitest verification? --- scripts/verify-mocha-results.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/verify-mocha-results.js b/scripts/verify-mocha-results.js index f2e3a0cdfb74..b830b41ed092 100644 --- a/scripts/verify-mocha-results.js +++ b/scripts/verify-mocha-results.js @@ -12,21 +12,32 @@ const path = require('path') const { readCircleEnv } = require('./circle-env') // mocha regex -const RESULT_REGEX = // +const MOCHA_REGEX = // // vitest regex -const VRESULT_REGEX = // +const VITEST_REGEX = // const REPORTS_PATH = '/tmp/cypress/junit' const expectedResultCount = Number(process.argv[process.argv.length - 1]) -const parseResult = (xml) => { - const [name, time, tests, failures, skipped] = (RESULT_REGEX.exec(xml) ?? VRESULT_REGEX.exec(xml)).slice(1) +const parseMochaResult = (xml) => { + const [name, time, tests, failures, skipped] = MOCHA_REGEX.exec(xml).slice(1) return { name, time, tests: Number(tests), failures: Number(failures), skipped: Number(skipped || 0), } } +const parseVitestResult = (xml) => { + const [name, tests, failures, , time, skipped] = VITEST_REGEX.exec(xml).slice(1) + + return { + name, time, tests: Number(tests), failures: Number(failures), skipped: Number(skipped || 0), + } +} + +const parseResult = (xml) => { + return MOCHA_REGEX.test(xml) ? parseMochaResult(xml) : parseVitestResult(xml) +} const total = { tests: 0, failures: 0, skipped: 0 } From cc42d8c69f77d3974821138881e2877f58dbfb71 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 10:19:46 -0500 Subject: [PATCH 19/27] add binary system test to verify correct file paths for codepoints in protocol events --- .../test-binary/invocation_details.ts | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 system-tests/test-binary/invocation_details.ts diff --git a/system-tests/test-binary/invocation_details.ts b/system-tests/test-binary/invocation_details.ts new file mode 100644 index 000000000000..ba91884d6a59 --- /dev/null +++ b/system-tests/test-binary/invocation_details.ts @@ -0,0 +1,106 @@ +import fs from 'fs-extra' +import path from 'path' +import systemTests from '../lib/system-tests' +import Fixtures from '../lib/fixtures' +import { + createRoutes, + setupStubbedServer, + enableCaptureProtocol, +} from '../lib/serverStub' + +// source: https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/ +const isoDateRegex = /"([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?"/g +const numberRegex = /"(wallClockDuration|fnDuration|afterFnDuration|lifecycle|duration|timestamp|createdAtTimestamp|updatedAtTimestamp|x|y|top|left|topCenter|leftCenter|requestId|cdpRequestWillBeSentTimestamp|cdpRequestWillBeSentReceivedTimestamp|proxyRequestReceivedTimestamp|cdpLagDuration|proxyRequestCorrelationDuration)": \"?(0|[1-9]\d*)(\.\d+)?\"?/g +const pathRegex = /"(name|absoluteFile)": "\/[^"]+"/g +const componentSpecPathRegex = /"(url|message)": "(http:\/\/localhost:2121\/__cypress\/iframes\/index.html\?specPath=)(.*)(\/protocol\/src\/components\/)(.*)"/g + +const normalizeEvents = (resultsJson) => { + return resultsJson + .replace(isoDateRegex, '"Any.ISODate"') + .replace(numberRegex, '"$1": "Any.Number"') + .replace(pathRegex, '"$1": "/path/to/$1"') + .replace(componentSpecPathRegex, '"$1": "$2$4$5"') +} + +const getFilePath = (filename) => { + return path.join( + Fixtures.projectPath('protocol'), + 'cypress', + 'system-tests-protocol-dbs', + `${filename}.json`, + ) +} + +describe('invocation details captured by protocol', () => { + setupStubbedServer(createRoutes()) + enableCaptureProtocol() + + describe('e2e', () => { + it('verifies the invocation filepaths are correct', function () { + const spec = 'protocol.cy.js,test-isolation.cy.js,shadow-dom.cy.js' + + return systemTests.exec(this, { + withBinary: true, + key: 'f858a2bc-b469-4e48-be67-0876339ee7e1', + project: 'protocol', + spec, + record: true, + expectedExitCode: 0, + port: 2121, + config: { + hosts: { + '*foobar.com': '127.0.0.1', + }, + }, + }).then(() => { + const protocolEvents = fs.readFileSync(getFilePath('e9e81b5e-cc58-4026-b2ff-8ae3161435a6.db'), 'utf8') + + const events = normalizeEvents(protocolEvents) + + const relativeFiles = spec.split(',').map((spec) => `cypress/e2e/${spec}`) + const originalFiles = relativeFiles.map((f) => `webpack://protocol-sample-project/./${f}`) + const fileUrls = relativeFiles.map((f) => `http://localhost:2121/__cypress/tests?p=${f}`) + + for (const { invocationDetails: { fileUrl, originalFile, relativeFile } } of events.beforeTest) { + expect(fileUrls).to.include(fileUrl) + expect(originalFiles).to.include(originalFile) + expect(relativeFiles).to.include(relativeFile) + } + }) + }) + }) + + describe('component', () => { + [true, false].forEach((experimentalSingleTabRunMode) => { + it('verifies the protocol events are correct', function () { + return systemTests.exec(this, { + withBinary: true, + key: 'f858a2bc-b469-4e48-be67-0876339ee7e1', + project: 'protocol', + record: true, + expectedExitCode: 0, + testingType: 'component', + port: 2121, + config: { + component: { + experimentalSingleTabRunMode, + }, + }, + }).then(() => { + const protocolEvents = fs.readFileSync(getFilePath('e9e81b5e-cc58-4026-b2ff-8ae3161435a6.db'), 'utf8') + const events = normalizeEvents(protocolEvents) + + const specs = ['HelloEarth.cy.jsx', 'HelloMars.cy.jsx'] + const relativeFiles = specs.map((s) => `src/components/${s}`) + const originalFiles = relativeFiles.map((f) => `webpack://protocol-sample-project/./${f}`) + + for (const { invocationDetails: { relativeFile, originalFile } } of events.beforeTest) { + expect(originalFiles).to.include(originalFile) + expect(relativeFiles).to.include(relativeFile) + } + fs.removeSync(getFilePath('e9e81b5e-cc58-4026-b2ff-8ae3161435a6.db')) + }) + }) + }) + }) +}) From 475fbfaa05aea43544f9d6e182ce61b6963734f5 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 11:04:22 -0500 Subject: [PATCH 20/27] fix invocation details system test filename --- .../{invocation_details.ts => invocation_details_spec.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename system-tests/test-binary/{invocation_details.ts => invocation_details_spec.ts} (100%) diff --git a/system-tests/test-binary/invocation_details.ts b/system-tests/test-binary/invocation_details_spec.ts similarity index 100% rename from system-tests/test-binary/invocation_details.ts rename to system-tests/test-binary/invocation_details_spec.ts From d0d799314826963251b2f0ec0ff12fa30fd947b9 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 11:35:36 -0500 Subject: [PATCH 21/27] add required config for binary tests --- system-tests/test-binary/invocation_details_spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system-tests/test-binary/invocation_details_spec.ts b/system-tests/test-binary/invocation_details_spec.ts index ba91884d6a59..c0c9380849f7 100644 --- a/system-tests/test-binary/invocation_details_spec.ts +++ b/system-tests/test-binary/invocation_details_spec.ts @@ -40,6 +40,8 @@ describe('invocation details captured by protocol', () => { const spec = 'protocol.cy.js,test-isolation.cy.js,shadow-dom.cy.js' return systemTests.exec(this, { + timeout: 240000, + dockerImage: 'cypress/base-internal:20.18.1-bullseye', withBinary: true, key: 'f858a2bc-b469-4e48-be67-0876339ee7e1', project: 'protocol', @@ -74,6 +76,8 @@ describe('invocation details captured by protocol', () => { [true, false].forEach((experimentalSingleTabRunMode) => { it('verifies the protocol events are correct', function () { return systemTests.exec(this, { + timeout: 240000, + dockerImage: 'cypress/base-internal:20.18.1-bullseye', withBinary: true, key: 'f858a2bc-b469-4e48-be67-0876339ee7e1', project: 'protocol', From bce0e553c293ddf58f9e2cc60d40b0b703df5fb3 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 12:43:51 -0500 Subject: [PATCH 22/27] build on darwin to fix binary system tests --- .circleci/workflows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index e78e185ad63f..0d99f3312d3b 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -44,6 +44,7 @@ macWorkflowFilters: &darwin-workflow-filters # use the following branch as well to ensure that v8 snapshot cache updates are fully tested - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ] - equal: [ 'chore/update_vue_test_utils', << pipeline.git.branch >> ] + - equal: [ 'cacie/fix-hook-test-stack-analysis', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> From 0c38ce9a3cb3a9e4c80936ad47c78bf9db808a59 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 13:47:21 -0500 Subject: [PATCH 23/27] build linux-arm64 for this branch --- .circleci/workflows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 0d99f3312d3b..ff984f6faa18 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -56,6 +56,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters # use the following branch as well to ensure that v8 snapshot cache updates are fully tested - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ] - equal: [ 'chore/update_binary_branch', << pipeline.git.branch >> ] + - equal: [ 'cacie/fix-hook-test-stack-analysis', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> From 4996e1125d1ad26c91b32cafe46cef1dad4e560d Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 16:11:26 -0500 Subject: [PATCH 24/27] simplify binary test --- .../invocation-details/cypress.config.js | 9 ++ .../cypress/e2e/block_codepoints.cy.js | 21 ++++ .../invocation-details/cypress/support.js | 0 .../test-binary/invocation_details_spec.ts | 114 ++---------------- 4 files changed, 38 insertions(+), 106 deletions(-) create mode 100644 system-tests/projects/invocation-details/cypress.config.js create mode 100644 system-tests/projects/invocation-details/cypress/e2e/block_codepoints.cy.js create mode 100644 system-tests/projects/invocation-details/cypress/support.js diff --git a/system-tests/projects/invocation-details/cypress.config.js b/system-tests/projects/invocation-details/cypress.config.js new file mode 100644 index 000000000000..2b0c067f299b --- /dev/null +++ b/system-tests/projects/invocation-details/cypress.config.js @@ -0,0 +1,9 @@ +const { defineConfig } = require('cypress') + +module.exports = defineConfig({ + retries: null, + e2e: { + specPattern: 'cypress/e2e/**/*.cy.js', + supportFile: 'cypress/support.js', + }, +}) diff --git a/system-tests/projects/invocation-details/cypress/e2e/block_codepoints.cy.js b/system-tests/projects/invocation-details/cypress/e2e/block_codepoints.cy.js new file mode 100644 index 000000000000..045840ea0f20 --- /dev/null +++ b/system-tests/projects/invocation-details/cypress/e2e/block_codepoints.cy.js @@ -0,0 +1,21 @@ +describe('invocationDetails', () => { + let tests = [] + + before(() => { + cy.on('test:before:run:async', (attr, test) => { + tests.push(test) + }) + }) + + it('has the correct file, line, and column numbers', () => { + expect(tests).to.have.length(1) + + const { fileUrl, originalFile, relativeFile, line, column } = tests[0]?.invocationDetails + + expect(fileUrl).to.eq('http://localhost:2121/__cypress/tests?p=cypress/e2e/block_codepoints.cy.js') + expect(relativeFile).to.eq('cypress/e2e/block_codepoints.cy.js') + expect(originalFile).to.eq('webpack://invocation-details/./cypress/e2e/block_codepoints.cy.js') + expect(line).to.eq(10) + expect(column).to.eq(3) + }) +}) diff --git a/system-tests/projects/invocation-details/cypress/support.js b/system-tests/projects/invocation-details/cypress/support.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/system-tests/test-binary/invocation_details_spec.ts b/system-tests/test-binary/invocation_details_spec.ts index c0c9380849f7..c4c838858698 100644 --- a/system-tests/test-binary/invocation_details_spec.ts +++ b/system-tests/test-binary/invocation_details_spec.ts @@ -1,110 +1,12 @@ -import fs from 'fs-extra' -import path from 'path' import systemTests from '../lib/system-tests' -import Fixtures from '../lib/fixtures' -import { - createRoutes, - setupStubbedServer, - enableCaptureProtocol, -} from '../lib/serverStub' -// source: https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/ -const isoDateRegex = /"([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?"/g -const numberRegex = /"(wallClockDuration|fnDuration|afterFnDuration|lifecycle|duration|timestamp|createdAtTimestamp|updatedAtTimestamp|x|y|top|left|topCenter|leftCenter|requestId|cdpRequestWillBeSentTimestamp|cdpRequestWillBeSentReceivedTimestamp|proxyRequestReceivedTimestamp|cdpLagDuration|proxyRequestCorrelationDuration)": \"?(0|[1-9]\d*)(\.\d+)?\"?/g -const pathRegex = /"(name|absoluteFile)": "\/[^"]+"/g -const componentSpecPathRegex = /"(url|message)": "(http:\/\/localhost:2121\/__cypress\/iframes\/index.html\?specPath=)(.*)(\/protocol\/src\/components\/)(.*)"/g - -const normalizeEvents = (resultsJson) => { - return resultsJson - .replace(isoDateRegex, '"Any.ISODate"') - .replace(numberRegex, '"$1": "Any.Number"') - .replace(pathRegex, '"$1": "/path/to/$1"') - .replace(componentSpecPathRegex, '"$1": "$2$4$5"') -} - -const getFilePath = (filename) => { - return path.join( - Fixtures.projectPath('protocol'), - 'cypress', - 'system-tests-protocol-dbs', - `${filename}.json`, - ) -} - -describe('invocation details captured by protocol', () => { - setupStubbedServer(createRoutes()) - enableCaptureProtocol() - - describe('e2e', () => { - it('verifies the invocation filepaths are correct', function () { - const spec = 'protocol.cy.js,test-isolation.cy.js,shadow-dom.cy.js' - - return systemTests.exec(this, { - timeout: 240000, - dockerImage: 'cypress/base-internal:20.18.1-bullseye', - withBinary: true, - key: 'f858a2bc-b469-4e48-be67-0876339ee7e1', - project: 'protocol', - spec, - record: true, - expectedExitCode: 0, - port: 2121, - config: { - hosts: { - '*foobar.com': '127.0.0.1', - }, - }, - }).then(() => { - const protocolEvents = fs.readFileSync(getFilePath('e9e81b5e-cc58-4026-b2ff-8ae3161435a6.db'), 'utf8') - - const events = normalizeEvents(protocolEvents) - - const relativeFiles = spec.split(',').map((spec) => `cypress/e2e/${spec}`) - const originalFiles = relativeFiles.map((f) => `webpack://protocol-sample-project/./${f}`) - const fileUrls = relativeFiles.map((f) => `http://localhost:2121/__cypress/tests?p=${f}`) - - for (const { invocationDetails: { fileUrl, originalFile, relativeFile } } of events.beforeTest) { - expect(fileUrls).to.include(fileUrl) - expect(originalFiles).to.include(originalFile) - expect(relativeFiles).to.include(relativeFile) - } - }) - }) - }) - - describe('component', () => { - [true, false].forEach((experimentalSingleTabRunMode) => { - it('verifies the protocol events are correct', function () { - return systemTests.exec(this, { - timeout: 240000, - dockerImage: 'cypress/base-internal:20.18.1-bullseye', - withBinary: true, - key: 'f858a2bc-b469-4e48-be67-0876339ee7e1', - project: 'protocol', - record: true, - expectedExitCode: 0, - testingType: 'component', - port: 2121, - config: { - component: { - experimentalSingleTabRunMode, - }, - }, - }).then(() => { - const protocolEvents = fs.readFileSync(getFilePath('e9e81b5e-cc58-4026-b2ff-8ae3161435a6.db'), 'utf8') - const events = normalizeEvents(protocolEvents) - - const specs = ['HelloEarth.cy.jsx', 'HelloMars.cy.jsx'] - const relativeFiles = specs.map((s) => `src/components/${s}`) - const originalFiles = relativeFiles.map((f) => `webpack://protocol-sample-project/./${f}`) - - for (const { invocationDetails: { relativeFile, originalFile } } of events.beforeTest) { - expect(originalFiles).to.include(originalFile) - expect(relativeFiles).to.include(relativeFile) - } - fs.removeSync(getFilePath('e9e81b5e-cc58-4026-b2ff-8ae3161435a6.db')) - }) - }) - }) +describe('invocation details', () => { + systemTests.it('passes the test that asserts file locations for invocation details', { + withBinary: true, + browser: 'electron', + dockerImage: 'cypress/base-internal:ubuntu22-node18', + project: 'invocation-details', + snapshot: false, + expectedExitCode: 0, }) }) From 22347031728c39241ef5ed5a9615019a48ae1a43 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Mon, 13 Jan 2025 16:12:41 -0500 Subject: [PATCH 25/27] build windows binary --- .circleci/workflows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index ff984f6faa18..79c4f8933ca2 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -80,6 +80,7 @@ windowsWorkflowFilters: &windows-workflow-filters # use the following branch as well to ensure that v8 snapshot cache updates are fully tested - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ] - equal: [ 'ryanm/chore/electron-33-upgrade', << pipeline.git.branch >> ] + - equal: [ 'cacie/fix-hook-test-stack-analysis', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> From 15ed6aaba2ec3d123a5ec20efcdc812719451495 Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Tue, 14 Jan 2025 09:21:24 -0500 Subject: [PATCH 26/27] rm binary system test --- .../invocation-details/cypress.config.js | 9 -------- .../cypress/e2e/block_codepoints.cy.js | 21 ------------------- .../invocation-details/cypress/support.js | 0 .../test-binary/invocation_details_spec.ts | 12 ----------- 4 files changed, 42 deletions(-) delete mode 100644 system-tests/projects/invocation-details/cypress.config.js delete mode 100644 system-tests/projects/invocation-details/cypress/e2e/block_codepoints.cy.js delete mode 100644 system-tests/projects/invocation-details/cypress/support.js delete mode 100644 system-tests/test-binary/invocation_details_spec.ts diff --git a/system-tests/projects/invocation-details/cypress.config.js b/system-tests/projects/invocation-details/cypress.config.js deleted file mode 100644 index 2b0c067f299b..000000000000 --- a/system-tests/projects/invocation-details/cypress.config.js +++ /dev/null @@ -1,9 +0,0 @@ -const { defineConfig } = require('cypress') - -module.exports = defineConfig({ - retries: null, - e2e: { - specPattern: 'cypress/e2e/**/*.cy.js', - supportFile: 'cypress/support.js', - }, -}) diff --git a/system-tests/projects/invocation-details/cypress/e2e/block_codepoints.cy.js b/system-tests/projects/invocation-details/cypress/e2e/block_codepoints.cy.js deleted file mode 100644 index 045840ea0f20..000000000000 --- a/system-tests/projects/invocation-details/cypress/e2e/block_codepoints.cy.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('invocationDetails', () => { - let tests = [] - - before(() => { - cy.on('test:before:run:async', (attr, test) => { - tests.push(test) - }) - }) - - it('has the correct file, line, and column numbers', () => { - expect(tests).to.have.length(1) - - const { fileUrl, originalFile, relativeFile, line, column } = tests[0]?.invocationDetails - - expect(fileUrl).to.eq('http://localhost:2121/__cypress/tests?p=cypress/e2e/block_codepoints.cy.js') - expect(relativeFile).to.eq('cypress/e2e/block_codepoints.cy.js') - expect(originalFile).to.eq('webpack://invocation-details/./cypress/e2e/block_codepoints.cy.js') - expect(line).to.eq(10) - expect(column).to.eq(3) - }) -}) diff --git a/system-tests/projects/invocation-details/cypress/support.js b/system-tests/projects/invocation-details/cypress/support.js deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/system-tests/test-binary/invocation_details_spec.ts b/system-tests/test-binary/invocation_details_spec.ts deleted file mode 100644 index c4c838858698..000000000000 --- a/system-tests/test-binary/invocation_details_spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -import systemTests from '../lib/system-tests' - -describe('invocation details', () => { - systemTests.it('passes the test that asserts file locations for invocation details', { - withBinary: true, - browser: 'electron', - dockerImage: 'cypress/base-internal:ubuntu22-node18', - project: 'invocation-details', - snapshot: false, - expectedExitCode: 0, - }) -}) From f70871bba805889c86d6605c7af398349553302c Mon Sep 17 00:00:00 2001 From: Cacie Prins Date: Tue, 14 Jan 2025 14:16:18 -0500 Subject: [PATCH 27/27] Update cli/CHANGELOG.md --- cli/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index ecfc83dda8f3..3f9a6008c0ff 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -55,7 +55,6 @@ in this [GitHub issue](https://github.com/cypress-io/cypress/issues/30447). Addr - Fixed a visibility issue for elements with `textContent` but without a width or height. Fixed in [#29688](https://github.com/cypress-io/cypress/pull/29688). Fixes [#29687](https://github.com/cypress-io/cypress/issues/29687). - Elements whose parent elements has `overflow: clip` and no height/width will now correctly show as hidden. Fixed in [#29778](https://github.com/cypress-io/cypress/pull/29778). Fixes [#23852](https://github.com/cypress-io/cypress/issues/23852). - The CSS pseudo-class `:dir()` is now supported when testing in Electron. Addresses [#29766](https://github.com/cypress-io/cypress/issues/29766). -- The Open in IDE button next to blocks and hooks in the runner UI will now properly open the IDE. This bug was introduced in a prerelease version of Cypress 14.0.0. Fixed in [#30859](https://github.com/cypress-io/cypress/pull/30859). Fixes [#30847](https://github.com/cypress-io/cypress/issues/30847). - Fixed an issue where the spec filename was not updating correctly when changing specs in `open` mode. Fixes [#30852](https://github.com/cypress-io/cypress/issues/30852). - `cy.origin()` now correctly errors when the [`cy.window()`](https://docs.cypress.io/api/commands/window), [`cy.document()`](https://docs.cypress.io/api/commands/document), [`cy.title()`](https://docs.cypress.io/api/commands/title), [`cy.url()`](https://docs.cypress.io/api/commands/url), [`cy.location()`](https://docs.cypress.io/api/commands/location) ,[`cy.hash()`](https://docs.cypress.io/api/commands/hash), [`cy.go()`](https://docs.cypress.io/api/commands/go), [`cy.reload()`](https://docs.cypress.io/api/commands/reload), and [`cy.scrollTo()`](https://docs.cypress.io/api/commands/scrollTo) commands are used outside of the `cy.origin()` command after the AUT has navigated away from the primary origin. Fixes [#30848](https://github.com/cypress-io/cypress/issues/30848). Fixed in [#30858](https://github.com/cypress-io/cypress/pull/30858).