From 71c130e1bf9ccc921e96de053cacd1be5c5620d2 Mon Sep 17 00:00:00 2001 From: Mike Maietta Date: Thu, 22 Feb 2024 22:50:22 -0800 Subject: [PATCH 1/5] fixing test file compilation and adding to CI suite --- .github/workflows/test.yaml | 6 +++--- test/src/updater/differentialUpdateTest.ts | 12 +++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9cb5577e682..0f1e0455ce9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -66,7 +66,7 @@ jobs: - name: Test run: pnpm ci:test env: - TEST_FILES: masTest,dmgTest,filesTest,macPackagerTest + TEST_FILES: masTest,dmgTest,filesTest,macPackagerTest,differentialUpdateTest FORCE_COLOR: 1 # Need to separate from other tests because logic is specific to when TOKEN env vars are set @@ -85,7 +85,7 @@ jobs: - name: Test run: pnpm ci:test env: - TEST_FILES: nsisUpdaterTest,linuxUpdaterTest,PublishManagerTest + TEST_FILES: nsisUpdaterTest,linuxUpdaterTest,PublishManagerTest,differentialUpdateTest KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }} BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }} GH_TOKEN: ${{ secrets.GH_TOKEN }} @@ -96,7 +96,7 @@ jobs: strategy: matrix: testFiles: - - winCodeSignTest + - winCodeSignTest,differentialUpdateTest - installerTest,appxTest,msiTest,portableTest,assistedInstallerTest,protonTest - BuildTest,oneClickInstallerTest,winPackagerTest,nsisUpdaterTest,webInstallerTest steps: diff --git a/test/src/updater/differentialUpdateTest.ts b/test/src/updater/differentialUpdateTest.ts index ff06dab5a71..c89d98dcd37 100644 --- a/test/src/updater/differentialUpdateTest.ts +++ b/test/src/updater/differentialUpdateTest.ts @@ -1,18 +1,16 @@ +import { Arch, Configuration, Platform } from "app-builder-lib" +import { getBinFromUrl } from "app-builder-lib/out/binDownload" import { doSpawn } from "builder-util" import { GenericServerOptions, S3Options } from "builder-util-runtime" -import { getBinFromUrl } from "app-builder-lib/out/binDownload" -import { Arch, Configuration, Platform } from "electron-builder" -import { AppImageUpdater } from "electron-updater/out/AppImageUpdater" -import { MacUpdater } from "electron-updater/out/MacUpdater" -import { NsisUpdater } from "electron-updater/out/NsisUpdater" +import { AppImageUpdater, MacUpdater, NsisUpdater } from "electron-updater" import { EventEmitter } from "events" import { move } from "fs-extra" import * as path from "path" import { TmpDir } from "temp-file" +import { TestAppAdapter } from "../helpers/TestAppAdapter" +import { nsisDifferentialUpdateFakeSnapshot, nsisWebDifferentialUpdateTestFakeSnapshot } from "../helpers/differentialUpdateTestSnapshotData" import { assertPack, removeUnstableProperties } from "../helpers/packTester" import { tuneTestUpdater, writeUpdateConfig } from "../helpers/updaterTestUtil" -import { nsisDifferentialUpdateFakeSnapshot, nsisWebDifferentialUpdateTestFakeSnapshot } from "../helpers/differentialUpdateTestSnapshotData" -import { TestAppAdapter } from "../helpers/TestAppAdapter" /* From 5fde0c61c7ef2037fdf0ba863fb326ca0483b229 Mon Sep 17 00:00:00 2001 From: Mike Maietta Date: Fri, 23 Feb 2024 07:51:05 -0800 Subject: [PATCH 2/5] tmp save, maybe I do need the babel config --- pnpm-lock.yaml | 553 ++++++++++++++++++++- test/babel.config.js | 3 + test/package.json | 5 + test/src/updater/differentialUpdateTest.ts | 8 +- 4 files changed, 542 insertions(+), 27 deletions(-) create mode 100644 test/babel.config.js diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f5269f38ea8..84f0ccee3a9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -621,6 +621,18 @@ importers: specifier: ^17.6.2 version: 17.7.2 devDependencies: + '@babel/core': + specifier: 7.15.5 + version: 7.15.5 + '@babel/preset-env': + specifier: 7.15.6 + version: 7.15.6(@babel/core@7.15.5) + '@babel/preset-typescript': + specifier: ^7.23.3 + version: 7.23.3(@babel/core@7.15.5) + '@jest/globals': + specifier: ^29.7.0 + version: 29.7.0 '@types/fs-extra': specifier: ^9.0.11 version: 9.0.13 @@ -633,6 +645,9 @@ importers: '@types/semver': specifier: ^7.3.13 version: 7.5.1 + babel-jest: + specifier: ^29.7.0 + version: 29.7.0(@babel/core@7.15.5) esbuild: specifier: ^0.12.14 version: 0.12.29 @@ -662,6 +677,13 @@ packages: '@babel/highlight': 7.22.13 chalk: 2.4.2 + /@babel/code-frame@7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.23.4 + chalk: 2.4.2 + /@babel/compat-data@7.22.9: resolution: {integrity: sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==} engines: {node: '>=6.9.0'} @@ -670,15 +692,15 @@ packages: resolution: {integrity: sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/generator': 7.22.10 '@babel/helper-compilation-targets': 7.22.10 - '@babel/helper-module-transforms': 7.22.9(@babel/core@7.15.5) + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.15.5) '@babel/helpers': 7.22.11 - '@babel/parser': 7.22.14 - '@babel/template': 7.22.5 + '@babel/parser': 7.23.9 + '@babel/template': 7.23.9 '@babel/traverse': 7.22.11 - '@babel/types': 7.22.11 + '@babel/types': 7.23.9 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -692,7 +714,7 @@ packages: resolution: {integrity: sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.23.9 '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.19 jsesc: 2.5.2 @@ -716,7 +738,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/compat-data': 7.22.9 - '@babel/helper-validator-option': 7.22.5 + '@babel/helper-validator-option': 7.23.5 browserslist: 4.21.10 lru-cache: 5.1.1 semver: 6.3.1 @@ -739,6 +761,24 @@ packages: semver: 6.3.1 dev: true + /@babel/helper-create-class-features-plugin@7.23.10(@babel/core@7.15.5): + resolution: {integrity: sha512-2XpP2XhkXzgxecPNEEK8Vz8Asj9aRxt08oKOqtiZoqV2UGZ5T+EkyP9sXQ9nwMxBIG34a7jmasVqoMop7VdPUw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.15.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.22.20(@babel/core@7.15.5) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + semver: 6.3.1 + dev: true + /@babel/helper-create-regexp-features-plugin@7.22.9(@babel/core@7.15.5): resolution: {integrity: sha512-+svjVa/tFwsNSG4NEy1h85+HQ5imbT92Q5/bgtS7P0GTQlP8WuFdqsiABmQouhiFGyV66oGxZFpeYHza1rNsKw==} engines: {node: '>=6.9.0'} @@ -769,6 +809,10 @@ packages: - supports-color dev: true + /@babel/helper-environment-visitor@7.22.20: + resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} + engines: {node: '>=6.9.0'} + /@babel/helper-environment-visitor@7.22.5: resolution: {integrity: sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==} engines: {node: '>=6.9.0'} @@ -780,6 +824,14 @@ packages: '@babel/template': 7.22.5 '@babel/types': 7.22.11 + /@babel/helper-function-name@7.23.0: + resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.23.9 + '@babel/types': 7.23.9 + dev: true + /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} @@ -793,11 +845,25 @@ packages: '@babel/types': 7.22.11 dev: true + /@babel/helper-member-expression-to-functions@7.23.0: + resolution: {integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.23.9 + dev: true + + /@babel/helper-module-imports@7.22.15: + resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.23.9 + /@babel/helper-module-imports@7.22.5: resolution: {integrity: sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.22.11 + dev: true /@babel/helper-module-transforms@7.22.9(@babel/core@7.15.5): resolution: {integrity: sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==} @@ -811,6 +877,20 @@ packages: '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.5 + dev: true + + /@babel/helper-module-transforms@7.23.3(@babel/core@7.15.5): + resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.15.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 /@babel/helper-optimise-call-expression@7.22.5: resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} @@ -835,6 +915,18 @@ packages: '@babel/helper-wrap-function': 7.22.10 dev: true + /@babel/helper-replace-supers@7.22.20(@babel/core@7.15.5): + resolution: {integrity: sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.15.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + dev: true + /@babel/helper-replace-supers@7.22.9(@babel/core@7.15.5): resolution: {integrity: sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg==} engines: {node: '>=6.9.0'} @@ -870,6 +962,14 @@ packages: resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} + /@babel/helper-string-parser@7.23.4: + resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} + engines: {node: '>=6.9.0'} + + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + /@babel/helper-validator-identifier@7.22.5: resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} engines: {node: '>=6.9.0'} @@ -877,6 +977,11 @@ packages: /@babel/helper-validator-option@7.22.5: resolution: {integrity: sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==} engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-option@7.23.5: + resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} + engines: {node: '>=6.9.0'} /@babel/helper-wrap-function@7.22.10: resolution: {integrity: sha512-OnMhjWjuGYtdoO3FmsEFWvBStBAe2QOgwOLsLNDjN+aaiMD8InJk1/O3HSD8lkqTjCgg5YI34Tz15KNNA3p+nQ==} @@ -905,6 +1010,14 @@ packages: chalk: 2.4.2 js-tokens: 4.0.0 + /@babel/highlight@7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + /@babel/parser@7.16.4: resolution: {integrity: sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng==} engines: {node: '>=6.0.0'} @@ -920,6 +1033,13 @@ packages: dependencies: '@babel/types': 7.22.11 + /@babel/parser@7.23.9: + resolution: {integrity: sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.23.9 + /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.22.5(@babel/core@7.15.5): resolution: {integrity: sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g==} engines: {node: '>=6.9.0'} @@ -1328,6 +1448,16 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: true + /@babel/plugin-syntax-jsx@7.23.3(@babel/core@7.15.5): + resolution: {integrity: sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.15.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.15.5): resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: @@ -1424,6 +1554,16 @@ packages: '@babel/core': 7.15.5 '@babel/helper-plugin-utils': 7.22.5 + /@babel/plugin-syntax-typescript@7.23.3(@babel/core@7.15.5): + resolution: {integrity: sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.15.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + /@babel/plugin-transform-arrow-functions@7.22.5(@babel/core@7.15.5): resolution: {integrity: sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==} engines: {node: '>=6.9.0'} @@ -1603,6 +1743,18 @@ packages: babel-plugin-dynamic-import-node: 2.3.3 dev: true + /@babel/plugin-transform-modules-commonjs@7.23.3(@babel/core@7.15.5): + resolution: {integrity: sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.15.5 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.15.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 + dev: true + /@babel/plugin-transform-modules-systemjs@7.22.11(@babel/core@7.15.5): resolution: {integrity: sha512-rIqHmHoMEOhI3VkVf5jQ15l539KrwhzqcBO6wdCNWPWc/JWt9ILNYNUssbRpeq0qWns8svuw8LnMNCvWBIJ8wA==} engines: {node: '>=6.9.0'} @@ -1808,6 +1960,19 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: true + /@babel/plugin-transform-typescript@7.23.6(@babel/core@7.15.5): + resolution: {integrity: sha512-6cBG5mBvUu4VUD04OHKnYzbuHNP8huDsD3EDqqpIpsswTDoqHCjLoHb6+QgsV1WsT2nipRqCPgxD3LXnEO7XfA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.15.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.23.10(@babel/core@7.15.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-typescript': 7.23.3(@babel/core@7.15.5) + dev: true + /@babel/plugin-transform-unicode-escapes@7.22.10(@babel/core@7.15.5): resolution: {integrity: sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg==} engines: {node: '>=6.9.0'} @@ -1839,7 +2004,7 @@ packages: '@babel/core': 7.15.5 '@babel/helper-compilation-targets': 7.22.10 '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-validator-option': 7.22.5 + '@babel/helper-validator-option': 7.23.5 '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.22.5(@babel/core@7.15.5) '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.15.5) '@babel/plugin-proposal-class-properties': 7.14.5(@babel/core@7.15.5) @@ -1903,7 +2068,7 @@ packages: '@babel/plugin-transform-unicode-escapes': 7.22.10(@babel/core@7.15.5) '@babel/plugin-transform-unicode-regex': 7.22.5(@babel/core@7.15.5) '@babel/preset-modules': 0.1.6(@babel/core@7.15.5) - '@babel/types': 7.22.11 + '@babel/types': 7.23.9 babel-plugin-polyfill-corejs2: 0.2.3(@babel/core@7.15.5) babel-plugin-polyfill-corejs3: 0.2.5(@babel/core@7.15.5) babel-plugin-polyfill-regenerator: 0.2.3(@babel/core@7.15.5) @@ -1941,6 +2106,20 @@ packages: '@babel/plugin-transform-react-pure-annotations': 7.22.5(@babel/core@7.15.5) dev: true + /@babel/preset-typescript@7.23.3(@babel/core@7.15.5): + resolution: {integrity: sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.15.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.23.5 + '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.15.5) + '@babel/plugin-transform-modules-commonjs': 7.23.3(@babel/core@7.15.5) + '@babel/plugin-transform-typescript': 7.23.6(@babel/core@7.15.5) + dev: true + /@babel/regjsgen@0.8.0: resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} dev: true @@ -1960,18 +2139,26 @@ packages: '@babel/parser': 7.22.14 '@babel/types': 7.22.11 + /@babel/template@7.23.9: + resolution: {integrity: sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.23.5 + '@babel/parser': 7.23.9 + '@babel/types': 7.23.9 + /@babel/traverse@7.22.11: resolution: {integrity: sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/generator': 7.22.10 '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-function-name': 7.22.5 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.22.14 - '@babel/types': 7.22.11 + '@babel/parser': 7.23.9 + '@babel/types': 7.23.9 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -1985,6 +2172,14 @@ packages: '@babel/helper-validator-identifier': 7.22.5 to-fast-properties: 2.0.0 + /@babel/types@7.23.9: + resolution: {integrity: sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} @@ -2424,6 +2619,33 @@ packages: '@types/node': 16.18.55 jest-mock: 27.5.1 + /@jest/environment@29.7.0: + resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 16.18.55 + jest-mock: 29.7.0 + dev: true + + /@jest/expect-utils@29.7.0: + resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.6.3 + dev: true + + /@jest/expect@29.7.0: + resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + expect: 29.7.0 + jest-snapshot: 29.7.0 + transitivePeerDependencies: + - supports-color + dev: true + /@jest/fake-timers@27.5.1: resolution: {integrity: sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -2435,6 +2657,18 @@ packages: jest-mock: 27.5.1 jest-util: 27.5.1 + /@jest/fake-timers@29.7.0: + resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@sinonjs/fake-timers': 10.3.0 + '@types/node': 16.18.55 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-util: 29.7.0 + dev: true + /@jest/globals@27.5.1: resolution: {integrity: sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -2443,6 +2677,18 @@ packages: '@jest/types': 27.5.1 expect: 27.5.1 + /@jest/globals@29.7.0: + resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/types': 29.6.3 + jest-mock: 29.7.0 + transitivePeerDependencies: + - supports-color + dev: true + /@jest/reporters@27.5.1: resolution: {integrity: sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -2480,6 +2726,13 @@ packages: transitivePeerDependencies: - supports-color + /@jest/schemas@29.6.3: + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.27.8 + dev: true + /@jest/source-map@27.5.1: resolution: {integrity: sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -2553,6 +2806,29 @@ packages: transitivePeerDependencies: - supports-color + /@jest/transform@29.7.0: + resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.15.5 + '@jest/types': 29.6.3 + '@jridgewell/trace-mapping': 0.3.19 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.7.0 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + micromatch: 4.0.5 + pirates: 4.0.6 + slash: 3.0.0 + write-file-atomic: 4.0.2 + transitivePeerDependencies: + - supports-color + dev: true + /@jest/types@26.6.2: resolution: {integrity: sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==} engines: {node: '>= 10.14.2'} @@ -2574,6 +2850,18 @@ packages: '@types/yargs': 16.0.5 chalk: 4.1.2 + /@jest/types@29.6.3: + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + '@types/istanbul-lib-coverage': 2.0.4 + '@types/istanbul-reports': 3.0.1 + '@types/node': 16.18.55 + '@types/yargs': 17.0.24 + chalk: 4.1.2 + dev: true + /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} @@ -2678,11 +2966,27 @@ packages: engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dev: true + /@sinclair/typebox@0.27.8: + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} + dev: true + /@sinonjs/commons@1.8.6: resolution: {integrity: sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==} dependencies: type-detect: 4.0.8 + /@sinonjs/commons@3.0.1: + resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} + dependencies: + type-detect: 4.0.8 + dev: true + + /@sinonjs/fake-timers@10.3.0: + resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + dependencies: + '@sinonjs/commons': 3.0.1 + dev: true + /@sinonjs/fake-timers@8.1.0: resolution: {integrity: sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==} dependencies: @@ -2722,8 +3026,8 @@ packages: /@types/babel__core@7.20.1: resolution: {integrity: sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==} dependencies: - '@babel/parser': 7.22.14 - '@babel/types': 7.22.11 + '@babel/parser': 7.23.9 + '@babel/types': 7.23.9 '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 '@types/babel__traverse': 7.20.1 @@ -2731,18 +3035,18 @@ packages: /@types/babel__generator@7.6.4: resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.23.9 /@types/babel__template@7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: - '@babel/parser': 7.22.14 - '@babel/types': 7.22.11 + '@babel/parser': 7.23.9 + '@babel/types': 7.23.9 /@types/babel__traverse@7.20.1: resolution: {integrity: sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.23.9 /@types/cross-spawn@6.0.2: resolution: {integrity: sha512-KuwNhp3eza+Rhu8IFI5HUXRP0LIhqH5cAjubUvGXXthh4YYBuP2ntwEX+Cz8GJoZUHlKo247wPWOfA9LYEq4cw==} @@ -3527,6 +3831,24 @@ packages: transitivePeerDependencies: - supports-color + /babel-jest@29.7.0(@babel/core@7.15.5): + resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + dependencies: + '@babel/core': 7.15.5 + '@jest/transform': 29.7.0 + '@types/babel__core': 7.20.1 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.6.3(@babel/core@7.15.5) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /babel-plugin-dynamic-import-node@2.3.3: resolution: {integrity: sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==} dependencies: @@ -3549,8 +3871,8 @@ packages: resolution: {integrity: sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==} engines: {node: '>= 10.14.2'} dependencies: - '@babel/template': 7.22.5 - '@babel/types': 7.22.11 + '@babel/template': 7.23.9 + '@babel/types': 7.23.9 '@types/babel__core': 7.20.1 '@types/babel__traverse': 7.20.1 dev: true @@ -3559,11 +3881,21 @@ packages: resolution: {integrity: sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@babel/template': 7.22.5 - '@babel/types': 7.22.11 + '@babel/template': 7.23.9 + '@babel/types': 7.23.9 '@types/babel__core': 7.20.1 '@types/babel__traverse': 7.20.1 + /babel-plugin-jest-hoist@29.6.3: + resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/template': 7.23.9 + '@babel/types': 7.23.9 + '@types/babel__core': 7.20.1 + '@types/babel__traverse': 7.20.1 + dev: true + /babel-plugin-polyfill-corejs2@0.2.3(@babel/core@7.15.5): resolution: {integrity: sha512-NDZ0auNRzmAfE1oDDPW2JhzIMXUk+FFe2ICejmt5T4ocKgiQx3e0VCRx9NCAidcMtL2RUZaWtXnmjTCkx0tcbA==} peerDependencies: @@ -3640,6 +3972,17 @@ packages: babel-plugin-jest-hoist: 27.5.1 babel-preset-current-node-syntax: 1.0.1(@babel/core@7.15.5) + /babel-preset-jest@29.6.3(@babel/core@7.15.5): + resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.15.5 + babel-plugin-jest-hoist: 29.6.3 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.15.5) + dev: true + /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -4280,6 +4623,10 @@ packages: /convert-source-map@1.9.0: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + /convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + dev: true + /copy-descriptor@0.1.1: resolution: {integrity: sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==} engines: {node: '>=0.10.0'} @@ -5068,6 +5415,11 @@ packages: resolution: {integrity: sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + /diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + /diff@4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} @@ -5512,6 +5864,17 @@ packages: jest-matcher-utils: 27.5.1 jest-message-util: 27.5.1 + /expect@29.7.0: + resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/expect-utils': 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + dev: true + /extend-shallow@2.0.1: resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==} engines: {node: '>=0.10.0'} @@ -6747,6 +7110,16 @@ packages: jest-get-type: 27.5.1 pretty-format: 27.5.1 + /jest-diff@29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + dev: true + /jest-docblock@27.5.1: resolution: {integrity: sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -6800,6 +7173,11 @@ packages: resolution: {integrity: sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + /jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + /jest-haste-map@26.6.2: resolution: {integrity: sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==} engines: {node: '>= 10.14.2'} @@ -6842,6 +7220,25 @@ packages: optionalDependencies: fsevents: 2.3.3 + /jest-haste-map@29.7.0: + resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@types/graceful-fs': 4.1.6 + '@types/node': 16.18.55 + anymatch: 3.1.3 + fb-watchman: 2.0.2 + graceful-fs: 4.2.11 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + jest-worker: 29.7.0 + micromatch: 4.0.5 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.3 + dev: true + /jest-jasmine2@27.5.1: resolution: {integrity: sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -6892,6 +7289,16 @@ packages: jest-get-type: 27.5.1 pretty-format: 27.5.1 + /jest-matcher-utils@29.7.0: + resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + dev: true + /jest-message-util@27.5.1: resolution: {integrity: sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -6906,6 +7313,21 @@ packages: slash: 3.0.0 stack-utils: 2.0.6 + /jest-message-util@29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/code-frame': 7.23.5 + '@jest/types': 29.6.3 + '@types/stack-utils': 2.0.1 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.5 + pretty-format: 29.7.0 + slash: 3.0.0 + stack-utils: 2.0.6 + dev: true + /jest-mock@27.5.1: resolution: {integrity: sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -6913,6 +7335,15 @@ packages: '@jest/types': 27.5.1 '@types/node': 16.18.55 + /jest-mock@29.7.0: + resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@types/node': 16.18.55 + jest-util: 29.7.0 + dev: true + /jest-pnp-resolver@1.2.3(jest-resolve@27.5.1): resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} engines: {node: '>=6'} @@ -6933,6 +7364,11 @@ packages: resolution: {integrity: sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + /jest-regex-util@29.6.3: + resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + /jest-resolve-dependencies@27.5.1: resolution: {integrity: sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -7062,6 +7498,34 @@ packages: transitivePeerDependencies: - supports-color + /jest-snapshot@29.7.0: + resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.15.5 + '@babel/generator': 7.22.10 + '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.15.5) + '@babel/plugin-syntax-typescript': 7.23.3(@babel/core@7.15.5) + '@babel/types': 7.23.9 + '@jest/expect-utils': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.15.5) + chalk: 4.1.2 + expect: 29.7.0 + graceful-fs: 4.2.11 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + natural-compare: 1.4.0 + pretty-format: 29.7.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + dev: true + /jest-util@26.6.2: resolution: {integrity: sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==} engines: {node: '>= 10.14.2'} @@ -7085,6 +7549,18 @@ packages: graceful-fs: 4.2.11 picomatch: 2.3.1 + /jest-util@29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.6.3 + '@types/node': 16.18.55 + chalk: 4.1.2 + ci-info: 3.8.0 + graceful-fs: 4.2.11 + picomatch: 2.3.1 + dev: true + /jest-validate@27.5.1: resolution: {integrity: sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -7125,6 +7601,16 @@ packages: merge-stream: 2.0.0 supports-color: 8.1.1 + /jest-worker@29.7.0: + resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@types/node': 16.18.55 + jest-util: 29.7.0 + merge-stream: 2.0.0 + supports-color: 8.1.1 + dev: true + /jest@27.5.1: resolution: {integrity: sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -8341,7 +8827,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -8516,6 +9002,15 @@ packages: ansi-styles: 5.2.0 react-is: 17.0.2 + /pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -8614,6 +9109,10 @@ packages: /react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} + /react-is@18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + dev: true + /read-config-file@6.3.2: resolution: {integrity: sha512-M80lpCjnE6Wt6zb98DoW8WHR09nzMSpu8XHtPkiTHrJ5Az9CybfeQhTJ8D7saeBHpGhLPIVyA8lcL6ZmdKwY6Q==} engines: {node: '>=12.0.0'} @@ -10236,6 +10735,14 @@ packages: signal-exit: 3.0.7 typedarray-to-buffer: 3.1.5 + /write-file-atomic@4.0.2: + resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + imurmurhash: 0.1.4 + signal-exit: 3.0.7 + dev: true + /ws@6.2.2: resolution: {integrity: sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==} peerDependencies: diff --git a/test/babel.config.js b/test/babel.config.js new file mode 100644 index 00000000000..4dd254128ce --- /dev/null +++ b/test/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: [['@babel/preset-env', { targets: { node: 'current' } }], "@babel/preset-typescript"], +}; \ No newline at end of file diff --git a/test/package.json b/test/package.json index e158cb2c47a..756f491f967 100644 --- a/test/package.json +++ b/test/package.json @@ -28,10 +28,15 @@ "yargs": "^17.6.2" }, "devDependencies": { + "@babel/core": "7.15.5", + "@babel/preset-env": "7.15.6", + "@babel/preset-typescript": "^7.23.3", + "@jest/globals": "^29.7.0", "@types/fs-extra": "^9.0.11", "@types/jest": "^26.0.23", "@types/js-yaml": "^4.0.1", "@types/semver": "^7.3.13", + "babel-jest": "^29.7.0", "esbuild": "^0.12.14", "esbuild-jest": "^0.5.0", "fast-xml-parser": "^4.0.15" diff --git a/test/src/updater/differentialUpdateTest.ts b/test/src/updater/differentialUpdateTest.ts index c89d98dcd37..8425d594cd5 100644 --- a/test/src/updater/differentialUpdateTest.ts +++ b/test/src/updater/differentialUpdateTest.ts @@ -26,7 +26,7 @@ const OLD_VERSION_NUMBER = "1.0.0" const testAppCacheDirName = "testapp-updater" -test.ifAll.ifDevOrWinCi("web installer", async () => { +test.ifWindows("web installer", async () => { let outDirs: Array = [] async function buildApp(version: string, tmpDir: TmpDir) { @@ -87,7 +87,7 @@ test.ifAll.ifDevOrWinCi("web installer", async () => { await testBlockMap(outDirs[0], path.join(outDirs[1], "nsis-web"), NsisUpdater, "win-unpacked", Platform.WINDOWS) }) -test.ifAll.ifDevOrWinCi("nsis", async () => { +test.ifWindows("nsis", async () => { let outDirs: Array = [] async function buildApp(version: string) { @@ -165,9 +165,9 @@ async function testLinux(arch: Arch) { } } -test.ifAll.ifDevOrLinuxCi("AppImage", () => testLinux(Arch.x64)) +test.ifDevOrLinuxCi("AppImage", () => testLinux(Arch.x64)) -test.ifAll.ifDevOrLinuxCi("AppImage ia32", () => testLinux(Arch.ia32)) +test.ifDevOrLinuxCi("AppImage ia32", () => testLinux(Arch.ia32)) // ifAll.ifMac.ifNotCi todo test.skip("dmg", async () => { From d37bb3204b51f46a1607e740ec1d03ffe56db35d Mon Sep 17 00:00:00 2001 From: Mike Maietta Date: Fri, 23 Feb 2024 13:22:39 -0800 Subject: [PATCH 3/5] linux is working --- .../updater/differentialUpdateTest.js.snap | 8 +-- test/src/updater/differentialUpdateTest.ts | 63 ++++++++++--------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/test/snapshots/updater/differentialUpdateTest.js.snap b/test/snapshots/updater/differentialUpdateTest.js.snap index 9c05a9930be..c158ae0a9dc 100644 --- a/test/snapshots/updater/differentialUpdateTest.js.snap +++ b/test/snapshots/updater/differentialUpdateTest.js.snap @@ -77,7 +77,7 @@ Object { "size": "@size", }, ], - "path": "TestApp-1.0.1-x86_64.AppImage", + "path": "Test App ßW-1.0.1.AppImage", "releaseDate": "@releaseDate", "sha512": "@sha512", "version": "1.0.1", @@ -86,7 +86,7 @@ Object { exports[`AppImage 4`] = ` Array [ - "TestApp-1.0.1-x86_64.AppImage", + "Test App ßW-1.0.1.AppImage", ] `; @@ -167,7 +167,7 @@ Object { "size": "@size", }, ], - "path": "TestApp-1.0.1-i386.AppImage", + "path": "Test App ßW-1.0.1-i386.AppImage", "releaseDate": "@releaseDate", "sha512": "@sha512", "version": "1.0.1", @@ -176,7 +176,7 @@ Object { exports[`AppImage ia32 4`] = ` Array [ - "TestApp-1.0.1-i386.AppImage", + "Test App ßW-1.0.1-i386.AppImage", ] `; diff --git a/test/src/updater/differentialUpdateTest.ts b/test/src/updater/differentialUpdateTest.ts index 8425d594cd5..6eda7d86585 100644 --- a/test/src/updater/differentialUpdateTest.ts +++ b/test/src/updater/differentialUpdateTest.ts @@ -9,8 +9,9 @@ import * as path from "path" import { TmpDir } from "temp-file" import { TestAppAdapter } from "../helpers/TestAppAdapter" import { nsisDifferentialUpdateFakeSnapshot, nsisWebDifferentialUpdateTestFakeSnapshot } from "../helpers/differentialUpdateTestSnapshotData" -import { assertPack, removeUnstableProperties } from "../helpers/packTester" +import { PackedContext, assertPack, removeUnstableProperties } from "../helpers/packTester" import { tuneTestUpdater, writeUpdateConfig } from "../helpers/updaterTestUtil" +import { exec } from "child_process" /* @@ -69,7 +70,7 @@ test.ifWindows("web installer", async () => { await buildApp("1.0.1", tmpDir) } catch (e: any) { - await tmpDir.cleanup() + // await tmpDir.cleanup() throw e } @@ -130,7 +131,7 @@ test.ifWindows("nsis", async () => { await buildApp("1.0.1") } catch (e: any) { - await tmpDir.cleanup() + // await tmpDir.cleanup() throw e } @@ -157,9 +158,10 @@ async function testLinux(arch: Arch) { const tmpDir = new TmpDir("differential-updater-test") try { await doBuild(outDirs, Platform.LINUX.createTarget(["appimage"], arch), tmpDir) + exec("open -a '/Applications/Sublime Text.app' " + path.resolve(outDirs[0], "..")) - process.env.APPIMAGE = path.join(outDirs[0], `TestApp-1.0.0-${arch === Arch.x64 ? "x86_64" : "i386"}.AppImage`) - await testBlockMap(outDirs[0], path.join(outDirs[1]), AppImageUpdater, `__appImage-${Arch[arch]}`, Platform.LINUX) + process.env.APPIMAGE = path.join(outDirs[0], `Test App ßW-${OLD_VERSION_NUMBER}${arch === Arch.ia32 ? "-i386" : ""}.AppImage`) + await testBlockMap(outDirs[0], outDirs[1], AppImageUpdater, `linux-${arch === Arch.ia32 ? "ia32-" : ""}unpacked`, Platform.LINUX) } finally { await tmpDir.cleanup() } @@ -186,7 +188,13 @@ test.skip("dmg", async () => { await testBlockMap(outDirs[0], path.join(outDirs[1]), MacUpdater, "mac/Test App ßW.app", Platform.MAC) }) -async function buildApp(version: string, outDirs: Array, targets: Map>>, tmpDir: TmpDir, extraConfig: Configuration | null | undefined) { +async function buildApp( + version: string, + outDirs: Array, + targets: Map>>, + extraConfig: Configuration | null | undefined, + packed: (context: PackedContext) => Promise +) { await assertPack( "test-app-one", { @@ -205,33 +213,33 @@ async function buildApp(version: string, outDirs: Array, targets: Map { - outDirs.push(context.outDir) - return Promise.resolve() - }, - tmpDir, + packed, + // packed: context => { + // log.error(context, 'packed') + // outDirs.push(context.outDir) + // return Promise.resolve() + // }, + // tmpDir, } ) } async function doBuild(outDirs: Array, targets: Map>>, tmpDir: TmpDir, extraConfig?: Configuration | null) { - await buildApp("1.0.0", outDirs, targets, tmpDir, extraConfig) + const build = (version: string) => + buildApp(version, outDirs, targets, extraConfig, async context => { + // move dist temporarily out of project dir so each downloader can reference it + const newDir = await tmpDir.getTempDir({ prefix: version }) + await move(context.outDir, newDir) + outDirs.push(newDir) + }) try { - // move dist temporarily out of project dir - const oldDir = await tmpDir.getTempDir() - await move(outDirs[0], oldDir) - outDirs[0] = oldDir - - await buildApp("1.0.1", outDirs, targets, tmpDir, extraConfig) + await build(OLD_VERSION_NUMBER) + await build("1.0.1") + console.warn("test", outDirs) } catch (e: any) { await tmpDir.cleanup() throw e } - - // move old dist to new project as oldDist - simplify development (no need to guess where old dist located in the temp fs) - const oldDir = path.join(outDirs[1], "..", "oldDist") - await move(outDirs[0], oldDir) - outDirs[0] = oldDir } async function checkResult(updater: NsisUpdater) { @@ -279,6 +287,7 @@ function getTestUpdaterCacheDir(oldDir: string) { } async function testBlockMap(oldDir: string, newDir: string, updaterClass: any, appUpdateConfigPath: string, platform: Platform) { + // log.error({ oldDir, newDir, appUpdateConfigPath }, "testBlockMap") const port = 8000 + (updaterClass.name.charCodeAt(0) as number) + Math.floor(Math.random() * 10000) // noinspection SpellCheckingInspection @@ -314,6 +323,7 @@ async function testBlockMap(oldDir: string, newDir: string, updaterClass: any, a updater.logger = console const currentUpdaterCacheDirName = (await updater.configOnDisk.value).updaterCacheDirName + console.warn("currentUpdaterCacheDirName", currentUpdaterCacheDirName) if (currentUpdaterCacheDirName == null) { throw new Error(`currentUpdaterCacheDirName must be not null, appUpdateConfigPath: ${updater._appUpdateConfigPath}`) } @@ -324,13 +334,6 @@ async function testBlockMap(oldDir: string, newDir: string, updaterClass: any, a url: `http://127.0.0.1:${port}`, }) - // updater.updateConfigPath = await writeUpdateConfig({ - // provider: "s3", - // endpoint: "http://192.168.178.34:9000", - // bucket: "develar", - // path: "onshape-test", - // }) - await checkResult(updater) } From 35ccf5f891d19bf8b2c63333ddcbe3ce7ffac39c Mon Sep 17 00:00:00 2001 From: Mike Maietta Date: Fri, 23 Feb 2024 14:27:59 -0800 Subject: [PATCH 4/5] massive cleanup and refactor --- .../updater/differentialUpdateTest.js.snap | 184 ---------------- .../differentialUpdateTestSnapshotData.ts | 203 ----------------- test/src/updater/differentialUpdateTest.ts | 208 ++++-------------- 3 files changed, 46 insertions(+), 549 deletions(-) delete mode 100644 test/src/helpers/differentialUpdateTestSnapshotData.ts diff --git a/test/snapshots/updater/differentialUpdateTest.js.snap b/test/snapshots/updater/differentialUpdateTest.js.snap index c158ae0a9dc..aa982b54418 100644 --- a/test/snapshots/updater/differentialUpdateTest.js.snap +++ b/test/snapshots/updater/differentialUpdateTest.js.snap @@ -180,190 +180,6 @@ Array [ ] `; -exports[`dmg 1`] = ` -Object { - "mac": Array [ - Object { - "arch": "x64", - "file": "Test App ßW-1.0.0.dmg", - "safeArtifactName": "TestApp-1.0.0.dmg", - "updateInfo": Object { - "sha512": "@sha512", - "size": "@size", - }, - }, - Object { - "file": "Test App ßW-1.0.0.dmg.blockmap", - "safeArtifactName": "TestApp-1.0.0.dmg.blockmap", - "updateInfo": Object { - "sha512": "@sha512", - "size": "@size", - }, - }, - Object { - "file": "latest-mac.yml", - "fileContent": Object { - "files": Array [ - Object { - "blockMapSize": "@blockMapSize", - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW-1.0.0-mac.zip", - }, - Object { - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW-1.0.0.dmg", - }, - ], - "path": "Test App ßW-1.0.0-mac.zip", - "releaseDate": "@releaseDate", - "sha512": "@sha512", - "version": "1.0.0", - }, - }, - Object { - "arch": "x64", - "file": "Test App ßW-1.0.0-mac.zip", - "safeArtifactName": "TestApp-1.0.0-mac.zip", - "updateInfo": Object { - "blockMapSize": "@blockMapSize", - "sha512": "@sha512", - "size": "@size", - }, - }, - ], -} -`; - -exports[`dmg 2`] = ` -Object { - "CFBundleDisplayName": "Test App ßW", - "CFBundleExecutable": "Test App ßW", - "CFBundleIconFile": "Test App ßW.icns", - "CFBundleIdentifier": "org.electron-builder.testApp", - "CFBundleInfoDictionaryVersion": "6.0", - "CFBundleName": "Test App ßW", - "CFBundlePackageType": "APPL", - "CFBundleShortVersionString": "1.0.0", - "LSApplicationCategoryType": "your.app.category.type", - "NSAppTransportSecurity": Object { - "NSAllowsLocalNetworking": true, - "NSExceptionDomains": Object { - "127.0.0.1": Object { - "NSIncludesSubdomains": false, - "NSTemporaryExceptionAllowsInsecureHTTPLoads": true, - "NSTemporaryExceptionAllowsInsecureHTTPSLoads": false, - "NSTemporaryExceptionMinimumTLSVersion": "1.0", - "NSTemporaryExceptionRequiresForwardSecrecy": false, - }, - "localhost": Object { - "NSIncludesSubdomains": false, - "NSTemporaryExceptionAllowsInsecureHTTPLoads": true, - "NSTemporaryExceptionAllowsInsecureHTTPSLoads": false, - "NSTemporaryExceptionMinimumTLSVersion": "1.0", - "NSTemporaryExceptionRequiresForwardSecrecy": false, - }, - }, - }, - "NSHighResolutionCapable": true, - "NSPrincipalClass": "AtomApplication", - "NSSupportsAutomaticGraphicsSwitching": true, -} -`; - -exports[`dmg 3`] = ` -Object { - "mac": Array [ - Object { - "arch": "x64", - "file": "Test App ßW-1.0.1.dmg", - "safeArtifactName": "TestApp-1.0.1.dmg", - "updateInfo": Object { - "sha512": "@sha512", - "size": "@size", - }, - }, - Object { - "file": "Test App ßW-1.0.1.dmg.blockmap", - "safeArtifactName": "TestApp-1.0.1.dmg.blockmap", - "updateInfo": Object { - "sha512": "@sha512", - "size": "@size", - }, - }, - Object { - "file": "latest-mac.yml", - "fileContent": Object { - "files": Array [ - Object { - "blockMapSize": "@blockMapSize", - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW-1.0.1-mac.zip", - }, - Object { - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW-1.0.1.dmg", - }, - ], - "path": "Test App ßW-1.0.1-mac.zip", - "releaseDate": "@releaseDate", - "sha512": "@sha512", - "version": "1.0.1", - }, - }, - Object { - "arch": "x64", - "file": "Test App ßW-1.0.1-mac.zip", - "safeArtifactName": "TestApp-1.0.1-mac.zip", - "updateInfo": Object { - "blockMapSize": "@blockMapSize", - "sha512": "@sha512", - "size": "@size", - }, - }, - ], -} -`; - -exports[`dmg 4`] = ` -Object { - "CFBundleDisplayName": "Test App ßW", - "CFBundleExecutable": "Test App ßW", - "CFBundleIconFile": "Test App ßW.icns", - "CFBundleIdentifier": "org.electron-builder.testApp", - "CFBundleInfoDictionaryVersion": "6.0", - "CFBundleName": "Test App ßW", - "CFBundlePackageType": "APPL", - "CFBundleShortVersionString": "1.0.1", - "LSApplicationCategoryType": "your.app.category.type", - "NSAppTransportSecurity": Object { - "NSAllowsLocalNetworking": true, - "NSExceptionDomains": Object { - "127.0.0.1": Object { - "NSIncludesSubdomains": false, - "NSTemporaryExceptionAllowsInsecureHTTPLoads": true, - "NSTemporaryExceptionAllowsInsecureHTTPSLoads": false, - "NSTemporaryExceptionMinimumTLSVersion": "1.0", - "NSTemporaryExceptionRequiresForwardSecrecy": false, - }, - "localhost": Object { - "NSIncludesSubdomains": false, - "NSTemporaryExceptionAllowsInsecureHTTPLoads": true, - "NSTemporaryExceptionAllowsInsecureHTTPSLoads": false, - "NSTemporaryExceptionMinimumTLSVersion": "1.0", - "NSTemporaryExceptionRequiresForwardSecrecy": false, - }, - }, - }, - "NSHighResolutionCapable": true, - "NSPrincipalClass": "AtomApplication", - "NSSupportsAutomaticGraphicsSwitching": true, -} -`; - exports[`nsis 1`] = ` Object { "win": Array [ diff --git a/test/src/helpers/differentialUpdateTestSnapshotData.ts b/test/src/helpers/differentialUpdateTestSnapshotData.ts deleted file mode 100644 index c8140819c82..00000000000 --- a/test/src/helpers/differentialUpdateTestSnapshotData.ts +++ /dev/null @@ -1,203 +0,0 @@ -export function nsisWebDifferentialUpdateTestFakeSnapshot() { - // to avoid snapshot mismatch (since in this node app is not packed) - expect({ - win: [ - { - file: "latest.yml", - fileContent: { - files: [ - { - sha512: "@sha512", - url: "Test App ßW Web Setup 1.0.0.exe", - }, - ], - packages: { - x64: { - blockMapSize: "@blockMapSize", - headerSize: "@headerSize", - path: "TestApp-1.0.0-x64.nsis.7z", - sha512: "@sha512", - size: "@size", - }, - }, - path: "Test App ßW Web Setup 1.0.0.exe", - releaseDate: "@releaseDate", - sha2: "@sha2", - sha512: "@sha512", - version: "1.0.0", - }, - }, - { - arch: "x64", - file: "Test App ßW Web Setup 1.0.0.exe", - safeArtifactName: "TestApp-WebSetup-1.0.0.exe", - updateInfo: { - packages: { - x64: { - blockMapSize: "@blockMapSize", - headerSize: "@headerSize", - path: "TestApp-1.0.0-x64.nsis.7z", - sha512: "@sha512", - size: "@size", - }, - }, - }, - }, - { - arch: "x64", - file: "TestApp-1.0.0-x64.nsis.7z", - }, - ], - }).toMatchSnapshot() - expect({ - win: [ - { - file: "latest.yml", - fileContent: { - files: [ - { - sha512: "@sha512", - url: "Test App ßW Web Setup 1.0.1.exe", - }, - ], - packages: { - x64: { - blockMapSize: "@blockMapSize", - headerSize: "@headerSize", - path: "TestApp-1.0.1-x64.nsis.7z", - sha512: "@sha512", - size: "@size", - }, - }, - path: "Test App ßW Web Setup 1.0.1.exe", - releaseDate: "@releaseDate", - sha2: "@sha2", - sha512: "@sha512", - version: "1.0.1", - }, - }, - { - arch: "x64", - file: "Test App ßW Web Setup 1.0.1.exe", - safeArtifactName: "TestApp-WebSetup-1.0.1.exe", - updateInfo: { - packages: { - x64: { - blockMapSize: "@blockMapSize", - headerSize: "@headerSize", - path: "TestApp-1.0.1-x64.nsis.7z", - sha512: "@sha512", - size: "@size", - }, - }, - }, - }, - { - arch: "x64", - file: "TestApp-1.0.1-x64.nsis.7z", - }, - ], - }).toMatchSnapshot() -} - -export function nsisDifferentialUpdateFakeSnapshot() { - // to avoid snapshot mismatch (since in this node app is not packed) - expect({ - win: [ - { - file: "latest.yml", - fileContent: { - files: [ - { - sha512: "@sha512", - url: "Test App ßW Web Setup 1.0.0.exe", - }, - ], - packages: { - x64: { - blockMapSize: "@blockMapSize", - headerSize: "@headerSize", - path: "TestApp-1.0.0-x64.nsis.7z", - sha512: "@sha512", - size: "@size", - }, - }, - path: "Test App ßW Web Setup 1.0.0.exe", - releaseDate: "@releaseDate", - sha2: "@sha2", - sha512: "@sha512", - version: "1.0.0", - }, - }, - { - arch: "x64", - file: "Test App ßW Web Setup 1.0.0.exe", - safeArtifactName: "TestApp-WebSetup-1.0.0.exe", - updateInfo: { - packages: { - x64: { - blockMapSize: "@blockMapSize", - headerSize: "@headerSize", - path: "TestApp-1.0.0-x64.nsis.7z", - sha512: "@sha512", - size: "@size", - }, - }, - }, - }, - { - arch: "x64", - file: "TestApp-1.0.0-x64.nsis.7z", - }, - ], - }).toMatchSnapshot() - expect({ - win: [ - { - file: "latest.yml", - fileContent: { - files: [ - { - sha512: "@sha512", - url: "Test App ßW Web Setup 1.0.1.exe", - }, - ], - packages: { - x64: { - blockMapSize: "@blockMapSize", - headerSize: "@headerSize", - path: "TestApp-1.0.1-x64.nsis.7z", - sha512: "@sha512", - size: "@size", - }, - }, - path: "Test App ßW Web Setup 1.0.1.exe", - releaseDate: "@releaseDate", - sha2: "@sha2", - sha512: "@sha512", - version: "1.0.1", - }, - }, - { - arch: "x64", - file: "Test App ßW Web Setup 1.0.1.exe", - safeArtifactName: "TestApp-WebSetup-1.0.1.exe", - updateInfo: { - packages: { - x64: { - blockMapSize: "@blockMapSize", - headerSize: "@headerSize", - path: "TestApp-1.0.1-x64.nsis.7z", - sha512: "@sha512", - size: "@size", - }, - }, - }, - }, - { - arch: "x64", - file: "TestApp-1.0.1-x64.nsis.7z", - }, - ], - }).toMatchSnapshot() -} diff --git a/test/src/updater/differentialUpdateTest.ts b/test/src/updater/differentialUpdateTest.ts index 6eda7d86585..67ce63912ac 100644 --- a/test/src/updater/differentialUpdateTest.ts +++ b/test/src/updater/differentialUpdateTest.ts @@ -8,10 +8,8 @@ import { move } from "fs-extra" import * as path from "path" import { TmpDir } from "temp-file" import { TestAppAdapter } from "../helpers/TestAppAdapter" -import { nsisDifferentialUpdateFakeSnapshot, nsisWebDifferentialUpdateTestFakeSnapshot } from "../helpers/differentialUpdateTestSnapshotData" import { PackedContext, assertPack, removeUnstableProperties } from "../helpers/packTester" import { tuneTestUpdater, writeUpdateConfig } from "../helpers/updaterTestUtil" -import { exec } from "child_process" /* @@ -27,20 +25,23 @@ const OLD_VERSION_NUMBER = "1.0.0" const testAppCacheDirName = "testapp-updater" -test.ifWindows("web installer", async () => { - let outDirs: Array = [] - - async function buildApp(version: string, tmpDir: TmpDir) { +async function doBuild(outDirs: Array, targets: Map>>, tmpDir: TmpDir, isWindows: boolean, extraConfig?: Configuration | null) { + async function buildApp( + version: string, + targets: Map>>, + extraConfig: Configuration | null | undefined, + packed: (context: PackedContext) => Promise + ) { await assertPack( "test-app-one", { - targets: Platform.WINDOWS.createTarget(["nsis-web"], Arch.x64), + targets, config: { extraMetadata: { version, }, - // package in any case compressed, customization is explicitly disabled - "do not allow to change compression level to avoid different packages" - compression: (process.env.COMPRESSION as any) || "store", + ...extraConfig, + compression: "normal", publish: { provider: "s3", bucket: "develar", @@ -49,104 +50,47 @@ test.ifWindows("web installer", async () => { }, }, { - signedWin: true, - packed: context => { - outDirs.push(context.outDir) - return Promise.resolve() - }, - tmpDir, + signedWin: isWindows, + packed, } ) } - if (process.env.__SKIP_BUILD == null) { - const tmpDir = new TmpDir("differential-updater-test") - try { - await buildApp(OLD_VERSION_NUMBER, tmpDir) - // move dist temporarily out of project dir - const oldDir = await tmpDir.getTempDir() - await move(outDirs[0], oldDir) - outDirs[0] = oldDir - - await buildApp("1.0.1", tmpDir) - } catch (e: any) { - // await tmpDir.cleanup() - throw e - } + const build = (version: string) => + buildApp(version, targets, extraConfig, async context => { + // move dist temporarily out of project dir so each downloader can reference it + const newDir = await tmpDir.getTempDir({ prefix: version }) + await move(context.outDir, newDir) + outDirs.push(newDir) + }) + try { + await build(OLD_VERSION_NUMBER) + await build("1.0.1") + } catch (e: any) { + await tmpDir.cleanup() + throw e + } +} - // move old dist to new project as oldDist - simplify development (no need to guess where old dist located in the temp fs) - const oldDir = path.join(outDirs[1], "..", "oldDist") - await move(outDirs[0], oldDir) - outDirs[0] = oldDir +test.ifWindows("web installer", async () => { + const outDirs: Array = [] + const tmpDir = new TmpDir("differential-updater-test") + await doBuild(outDirs, Platform.WINDOWS.createTarget(["nsis-web"], Arch.x64), tmpDir, true) - await move(path.join(oldDir, "nsis-web", `TestApp-${OLD_VERSION_NUMBER}-x64.nsis.7z`), path.join(getTestUpdaterCacheDir(oldDir), testAppCacheDirName, "package.7z")) - } else { - nsisWebDifferentialUpdateTestFakeSnapshot() - outDirs = [path.join(process.env.TEST_APP_TMP_DIR!, "oldDist"), path.join(process.env.TEST_APP_TMP_DIR!, "dist")] - } + const oldDir = outDirs[0] + await move(path.join(oldDir, "nsis-web", `TestApp-${OLD_VERSION_NUMBER}-x64.nsis.7z`), path.join(getTestUpdaterCacheDir(oldDir), testAppCacheDirName, "package.7z")) await testBlockMap(outDirs[0], path.join(outDirs[1], "nsis-web"), NsisUpdater, "win-unpacked", Platform.WINDOWS) }) test.ifWindows("nsis", async () => { - let outDirs: Array = [] - - async function buildApp(version: string) { - await assertPack( - "test-app-one", - { - targets: Platform.WINDOWS.createTarget(["nsis"], Arch.x64), - config: { - extraMetadata: { - version, - }, - // package in any case compressed, customization is explicitly disabled - "do not allow to change compression level to avoid different packages" - compression: (process.env.COMPRESSION as any) || "store", - publish: { - provider: "s3", - bucket: "develar", - path: "test", - }, - }, - }, - { - signedWin: true, - packed: context => { - outDirs.push(context.outDir) - return Promise.resolve() - }, - } - ) - } - - if (process.env.__SKIP_BUILD == null) { - await buildApp(OLD_VERSION_NUMBER) - - const tmpDir = new TmpDir("differential-updater-test") - try { - // move dist temporarily out of project dir - const oldDir = await tmpDir.getTempDir() - await move(outDirs[0], oldDir) - outDirs[0] = oldDir - - await buildApp("1.0.1") - } catch (e: any) { - // await tmpDir.cleanup() - throw e - } - - // move old dist to new project as oldDist - simplify development (no need to guess where old dist located in the temp fs) - const oldDir = path.join(outDirs[1], "..", "oldDist") - await move(outDirs[0], oldDir) - outDirs[0] = oldDir - - await move(path.join(oldDir, `Test App ßW Setup ${OLD_VERSION_NUMBER}.exe`), path.join(getTestUpdaterCacheDir(oldDir), testAppCacheDirName, "installer.exe")) - await move(path.join(oldDir, "Test App ßW Setup 1.0.0.exe.blockmap"), path.join(outDirs[1], "Test App ßW Setup 1.0.0.exe.blockmap")) - } else { - nsisDifferentialUpdateFakeSnapshot() + const outDirs: Array = [] + const tmpDir = new TmpDir("differential-updater-test") + await doBuild(outDirs, Platform.WINDOWS.createTarget(["nsis"], Arch.x64), tmpDir, true) - outDirs = [path.join(process.env.TEST_APP_TMP_DIR!, "oldDist"), path.join(process.env.TEST_APP_TMP_DIR!, "dist")] - } + const oldDir = outDirs[0] + await move(path.join(oldDir, `Test App ßW Setup ${OLD_VERSION_NUMBER}.exe`), path.join(getTestUpdaterCacheDir(oldDir), testAppCacheDirName, "installer.exe")) + await move(path.join(oldDir, `Test App ßW Setup ${OLD_VERSION_NUMBER}.exe.blockmap`), path.join(outDirs[1], "Test App ßW Setup 1.0.0.exe.blockmap")) await testBlockMap(outDirs[0], outDirs[1], NsisUpdater, "win-unpacked", Platform.WINDOWS) }) @@ -157,8 +101,7 @@ async function testLinux(arch: Arch) { const outDirs: Array = [] const tmpDir = new TmpDir("differential-updater-test") try { - await doBuild(outDirs, Platform.LINUX.createTarget(["appimage"], arch), tmpDir) - exec("open -a '/Applications/Sublime Text.app' " + path.resolve(outDirs[0], "..")) + await doBuild(outDirs, Platform.LINUX.createTarget(["appimage"], arch), tmpDir, false) process.env.APPIMAGE = path.join(outDirs[0], `Test App ßW-${OLD_VERSION_NUMBER}${arch === Arch.ia32 ? "-i386" : ""}.AppImage`) await testBlockMap(outDirs[0], outDirs[1], AppImageUpdater, `linux-${arch === Arch.ia32 ? "ia32-" : ""}unpacked`, Platform.LINUX) @@ -172,76 +115,18 @@ test.ifDevOrLinuxCi("AppImage", () => testLinux(Arch.x64)) test.ifDevOrLinuxCi("AppImage ia32", () => testLinux(Arch.ia32)) // ifAll.ifMac.ifNotCi todo -test.skip("dmg", async () => { +test.skip("zip", async () => { const outDirs: Array = [] const tmpDir = new TmpDir("differential-updater-test") - if (process.env.__SKIP_BUILD == null) { - await doBuild(outDirs, Platform.MAC.createTarget(undefined, Arch.x64), tmpDir, { - mac: { - electronUpdaterCompatibility: ">=2.17.0", - }, - }) - } else { - // todo - } + await doBuild(outDirs, Platform.MAC.createTarget(["zip"], Arch.x64), tmpDir, false, { + mac: { + electronUpdaterCompatibility: ">=2.17.0", + }, + }) await testBlockMap(outDirs[0], path.join(outDirs[1]), MacUpdater, "mac/Test App ßW.app", Platform.MAC) }) -async function buildApp( - version: string, - outDirs: Array, - targets: Map>>, - extraConfig: Configuration | null | undefined, - packed: (context: PackedContext) => Promise -) { - await assertPack( - "test-app-one", - { - targets, - config: { - extraMetadata: { - version, - }, - ...extraConfig, - compression: "normal", - publish: { - provider: "s3", - bucket: "develar", - path: "test", - }, - }, - }, - { - packed, - // packed: context => { - // log.error(context, 'packed') - // outDirs.push(context.outDir) - // return Promise.resolve() - // }, - // tmpDir, - } - ) -} - -async function doBuild(outDirs: Array, targets: Map>>, tmpDir: TmpDir, extraConfig?: Configuration | null) { - const build = (version: string) => - buildApp(version, outDirs, targets, extraConfig, async context => { - // move dist temporarily out of project dir so each downloader can reference it - const newDir = await tmpDir.getTempDir({ prefix: version }) - await move(context.outDir, newDir) - outDirs.push(newDir) - }) - try { - await build(OLD_VERSION_NUMBER) - await build("1.0.1") - console.warn("test", outDirs) - } catch (e: any) { - await tmpDir.cleanup() - throw e - } -} - async function checkResult(updater: NsisUpdater) { const updateCheckResult = await updater.checkForUpdates() const downloadPromise = updateCheckResult?.downloadPromise @@ -287,7 +172,6 @@ function getTestUpdaterCacheDir(oldDir: string) { } async function testBlockMap(oldDir: string, newDir: string, updaterClass: any, appUpdateConfigPath: string, platform: Platform) { - // log.error({ oldDir, newDir, appUpdateConfigPath }, "testBlockMap") const port = 8000 + (updaterClass.name.charCodeAt(0) as number) + Math.floor(Math.random() * 10000) // noinspection SpellCheckingInspection From ffa2837dd3e06221ae6d66a3189304099998ddec Mon Sep 17 00:00:00 2001 From: Mike Maietta Date: Fri, 23 Feb 2024 16:11:56 -0800 Subject: [PATCH 5/5] cleanup console logging --- test/src/updater/differentialUpdateTest.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/test/src/updater/differentialUpdateTest.ts b/test/src/updater/differentialUpdateTest.ts index 67ce63912ac..9ba8cc9be66 100644 --- a/test/src/updater/differentialUpdateTest.ts +++ b/test/src/updater/differentialUpdateTest.ts @@ -207,7 +207,6 @@ async function testBlockMap(oldDir: string, newDir: string, updaterClass: any, a updater.logger = console const currentUpdaterCacheDirName = (await updater.configOnDisk.value).updaterCacheDirName - console.warn("currentUpdaterCacheDirName", currentUpdaterCacheDirName) if (currentUpdaterCacheDirName == null) { throw new Error(`currentUpdaterCacheDirName must be not null, appUpdateConfigPath: ${updater._appUpdateConfigPath}`) }