From 9de321c7797ab4b7c17cf7692ac720a1d120e17c Mon Sep 17 00:00:00 2001 From: ANGkeith Date: Fri, 11 Oct 2024 02:53:41 +0800 Subject: [PATCH] Refactor/esm (#1331) * esm * ts2esm vodoo * bump axios major version for esm support * replace ts-node with tsx * importing json files in esm * refactor: yargs esm * quickfix: downgrade axios to fix type problems with axios-mock-adapter * fix import issues * jest + esm * replace global jest with import.meta.jest - https://jestjs.io/docs/ecmascript-modules#differences-between-esm-and-commonjs * install esbuild * pkg+esbuild * make it possible to run jest without npm run build * manage to get ts-node to work - when using tsx unable to get source-mapping to work * fix npm run test-except-dind * tweak tsconfig * attempt to run npm coverage without building * only way i manage to get npm run coverage to work - was getting the exact same error as per https://github.com/jestjs/jest/issues/15000 * resolve esbuild warning with direct eval * fix `pkg` warnings * docs: update docs * Use @yao-pkg/pkg. Use bin/ instead of pkg/ folder * Upgrade axios * Reintroduce babel-jest * Rename github action job to smoke-test * Use node20 for pkg vm * Fix user-agent --------- Co-authored-by: Mads Jon Nielsen --- .github/workflows/build.yml | 8 +- .gitignore | 1 + README.md | 3 - package-lock.json | 914 +++++++++++++----- package.json | 39 +- src/argv.ts | 6 +- src/commander.ts | 12 +- src/data-expander.ts | 4 +- src/executor.ts | 4 +- src/git-data.ts | 4 +- src/handler.ts | 20 +- src/index.ts | 28 +- src/job.ts | 16 +- src/parser-includes.ts | 10 +- src/parser.ts | 26 +- src/predefined-variables.ts | 2 +- src/producers.ts | 4 +- src/schema/index.ts | 9 +- src/state.ts | 2 +- src/utils.ts | 10 +- src/validator.ts | 6 +- src/variables-from-files.ts | 10 +- tests/cases.test.ts | 6 +- tests/expand.test.ts | 4 +- tests/git-data.test.ts | 6 +- tests/mocks/utils.mock.ts | 12 +- tests/print-funcs.test.ts | 4 +- tests/process-write-streams.test.ts | 6 +- tests/rules-regex.test.ts | 6 +- tests/rules.test.ts | 6 +- .../integration.after-script.test.ts | 8 +- ...ration.artifacts-after-afterscript.test.ts | 10 +- ...ration.artifacts-after-afterscript.test.ts | 8 +- .../integration.artifacts-docker.test.ts | 10 +- .../integration.artifacts-dotenv.test.ts | 8 +- .../integration.artifacts-exclude.test.ts | 8 +- .../integration.artifacts-globstar.test.ts | 8 +- ...integration.artifacts-no-shell-out.test.ts | 8 +- ...tegration.artifacts-reports-dotenv.test.ts | 8 +- .../integration.artifacts-sequence.test.ts | 8 +- ...ration.artifacts-shell-fail-always.test.ts | 8 +- .../integration.artifacts-shell-fail.test.ts | 8 +- .../integration.artifacts-shell.test.ts | 8 +- ...integration.artifacts-to-source-no.test.ts | 8 +- .../integration.artifacts-with-cache.test.ts | 8 +- .../integration.before-script-default.test.ts | 8 +- .../integration.before-script.test.ts | 8 +- ...tegration.cache-conditional-policy.test.ts | 8 +- .../integration.cache-directives.test.ts | 8 +- ...gration.cache-docker-mount-invalid.test.ts | 10 +- .../integration.cache-docker-mount.test.ts | 12 +- .../integration.cache-docker.test.ts | 8 +- .../integration.cache-double-run.test.ts | 8 +- .../integration.key-files.test.ts | 8 +- .../integration.key-invalid-files.test.ts | 8 +- .../integration.cache-paths-not-array.test.ts | 8 +- ...ration.cache-paths-undefined-array.test.ts | 8 +- .../integration.cache-shell-fail.test.ts | 8 +- .../integration.cache-shell.test.ts | 8 +- .../cache-when/integration.cache-when.test.ts | 8 +- .../integration.cli-option-variables.test.ts | 8 +- .../integration.concurrency.test.ts | 8 +- .../container-executable.test.ts | 8 +- tests/test-cases/coverage/.gitlab-ci.yml | 2 +- .../coverage/integration.coverage.test.ts | 14 +- .../integration.custom-home.test.ts | 8 +- ...integration.dependencies-not-found.test.ts | 8 +- .../integration.dind-no-tls.test.ts | 10 +- .../dind-tls/integration.dind-tls.test.ts | 10 +- .../dotenv/integration.dotenv.test.ts | 8 +- .../integration.environment.test.ts | 8 +- .../integration.environment.test.ts | 8 +- .../extends/integration.extends.test.ts | 8 +- .../extra-host/integration.extra-host.test.ts | 8 +- .../integration.emulate-runner.test.ts | 12 +- .../integration.hang-forever.test.ts | 8 +- .../image/integration.image.test.ts | 12 +- .../integration.include-component.test.ts | 8 +- .../integration.include-inputs.test.ts | 8 +- .../integration.include-invalid-local.test.ts | 8 +- ...n.include-invalid-project-ref-file.test.ts | 8 +- ...integration.include-invalid-remote.test.ts | 8 +- .../integration.include-local.test.ts | 8 +- .../integration.include-local.test.ts | 8 +- .../integration.needs-empty.test.ts | 10 +- ...-project-file-ref-with-inner-local.test.ts | 8 +- ...tegration.include-project-file-ref.test.ts | 8 +- .../integration.include-remote.test.ts | 8 +- .../integration.include-rules.test.ts | 8 +- .../integration.include-template.test.ts | 8 +- .../integration.interactive-image.test.ts | 8 +- .../integration.interactive.test.ts | 8 +- .../integration.invalid-stages.test.ts | 8 +- .../list-case/integration.list-case.test.ts | 8 +- .../integration.list-case.test.ts | 8 +- .../integration.plain.log-padding.test.ts | 8 +- .../integration.plain.log-timestamps.test.ts | 8 +- .../long-running-silent-build-job.test.ts | 10 +- .../long-running-silent-test-job.test.ts | 10 +- .../integration.environment.test.ts | 8 +- .../manual/integration.manual.test.ts | 8 +- .../integration.needs-artifacts.test.ts | 8 +- ...ration.needs-contains-dependencies.test.ts | 8 +- .../integration.needs-empty.test.ts | 8 +- .../integration.needs-invalid-stage.test.ts | 8 +- ...integration.needs-optional-complex.test.ts | 8 +- .../integration.needs-optional.test.ts | 8 +- .../integration.needs-parallel.test.ts | 8 +- .../integration.needs-pipeline.test.ts | 8 +- .../integration.needs-same-stage.test.ts | 8 +- .../integration.needs-sequence.test.ts | 8 +- .../integration.needs-unspecified-job.test.ts | 8 +- .../integration.network-alias-build.test.ts | 8 +- .../integration.network-arg.test.ts | 10 +- .../integration.never-needs.test.ts | 8 +- .../never/integration.never.test.ts | 8 +- .../no-script/integration.no-script.test.ts | 8 +- .../integration.parallel-matrix.test.ts | 6 +- .../parallel/integration.parallel.test.ts | 4 +- .../plain/integration.plain.test.ts | 8 +- .../integration.predefined-variables.test.ts | 8 +- .../preview/integration.preview.test.ts | 8 +- ...integration.project-variables-file.test.ts | 8 +- .../integration.pull-policy.test.ts | 12 +- ...tegration.reference-circular-chain.test.ts | 8 +- .../reference/integration.reference.test.ts | 8 +- ...integration.project-variables-file.test.ts | 8 +- .../integration.rules-changes.test.ts | 8 +- .../integration.rules-exists.test.ts | 8 +- .../integration.schema-validation.test.ts | 10 +- .../integration.script-blank.test.ts | 8 +- .../integration.script-failures.test.ts | 8 +- .../integration.script-multidimension.test.ts | 8 +- .../integration.scripts-as-string.test.ts | 8 +- .../services/integration.services.test.ts | 10 +- .../integration.stage-not-found.test.ts | 8 +- .../trigger/integration.trigger.test.ts | 8 +- .../umask/integration.umask.test.ts | 10 +- .../integration.variable-escaping.test.ts | 8 +- .../integration.variable-expansion.test.ts | 8 +- .../integration.variable-order.test.ts | 8 +- .../integration.variables-null.test.ts | 8 +- .../integration.when-always.test.ts | 8 +- .../integration.on-failure.test.ts | 8 +- .../test-cases/when/integration.when.test.ts | 8 +- tests/utils.test.ts | 10 +- tests/utils.ts | 2 +- tsconfig.json | 7 +- 148 files changed, 1293 insertions(+), 868 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3d64d36b..3ed2b0d86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: with: strict: true - pkg: + smoke-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -33,9 +33,9 @@ jobs: path: ${{ env.PKG_CACHE_PATH }} key: pkg-cache-${{ matrix.node-version }} - run: npm ci - - run: npm run build + - run: npm run esbuild - run: npm run pkg-linux - - run: node src/index.js --version + - run: node bin/index.cjs --version - run: bin/linux/gitlab-ci-local --version - run: bin/linux/gitlab-ci-local --help @@ -70,7 +70,7 @@ jobs: cache: 'npm' - run: npm ci - name: Run Tests - run: FORCE_COLOR=1 npx jest --coverage --testTimeout 90000 --verbose + run: npm run coverage - uses: sonarsource/sonarcloud-github-action@v3.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 4edeec9c4..82fbc3f89 100644 --- a/.gitignore +++ b/.gitignore @@ -20,5 +20,6 @@ tsconfig.tsbuildinfo .DS_Store .vscode +pkg /.gitlab-ci.yml diff --git a/README.md b/README.md index 337371d85..3240f5b1e 100644 --- a/README.md +++ b/README.md @@ -368,9 +368,6 @@ You need nodejs 18+ # Install node_modules npm install -# Compiled typescript to javascript -npm run build - # Run all tests npm run test diff --git a/package-lock.json b/package-lock.json index 606e8a9b0..5ab9f5ade 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "ajv": "8.x.x", - "axios": "0.28.x", + "axios": "^1.7.7", "base64url": "3.x.x", "camelcase": "6.x.x", "chalk": "4.x.x", @@ -50,13 +50,14 @@ "@types/yargs": "17.x.x", "@typescript-eslint/eslint-plugin": "7.x.x", "@typescript-eslint/parser": "7.x.x", + "@yao-pkg/pkg": "^5.15.0", "axios-mock-adapter": "2.x", "depcheck": "1.x.x", + "esbuild": "^0.23.1", "eslint": "8.x.x", "jest": "29.x.x", "jest-when": "3.x.x", "nodemon": "^3.1.1", - "pkg": "5.x.x", "ts-jest": "29.x.x", "ts-node": "10.x.x", "typescript": "5.x.x" @@ -717,6 +718,390 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -1926,66 +2311,258 @@ "dev": true, "license": "ISC" }, - "node_modules/@vue/compiler-core": { - "version": "3.5.11", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.11.tgz", - "integrity": "sha512-PwAdxs7/9Hc3ieBO12tXzmTD+Ln4qhT/56S+8DvrrZ4kLDn4Z/AMUr8tXJD0axiJBS0RKIoNaR0yMuQB9v9Udg==", + "node_modules/@vue/compiler-core": { + "version": "3.5.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.11.tgz", + "integrity": "sha512-PwAdxs7/9Hc3ieBO12tXzmTD+Ln4qhT/56S+8DvrrZ4kLDn4Z/AMUr8tXJD0axiJBS0RKIoNaR0yMuQB9v9Udg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/shared": "3.5.11", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.11.tgz", + "integrity": "sha512-pyGf8zdbDDRkBrEzf8p7BQlMKNNF5Fk/Cf/fQ6PiUz9at4OaUfyXW0dGJTo2Vl1f5U9jSLCNf0EZJEogLXoeew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.11", + "@vue/shared": "3.5.11" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.11.tgz", + "integrity": "sha512-gsbBtT4N9ANXXepprle+X9YLg2htQk1sqH/qGJ/EApl+dgpUBdTv3yP7YlR535uHZY3n6XaR0/bKo0BgwwDniw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/compiler-core": "3.5.11", + "@vue/compiler-dom": "3.5.11", + "@vue/compiler-ssr": "3.5.11", + "@vue/shared": "3.5.11", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.11", + "postcss": "^8.4.47", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.11.tgz", + "integrity": "sha512-P4+GPjOuC2aFTk1Z4WANvEhyOykcvEd5bIj2KVNGKGfM745LaXGr++5njpdBTzVz5pZifdlR1kpYSJJpIlSePA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.11", + "@vue/shared": "3.5.11" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.11", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.11.tgz", + "integrity": "sha512-W8GgysJVnFo81FthhzurdRAWP/byq3q2qIw70e0JWblzVhjgOMiC2GyovXrZTFQJnFVryYaKGP3Tc9vYzYm6PQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@yao-pkg/pkg": { + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/@yao-pkg/pkg/-/pkg-5.15.0.tgz", + "integrity": "sha512-VKgSO7Djch98NEByNJucpuqVlGre5cyhCHeQ1CfhetMCOrl5X146lJCDNsRyq9vP7KpajPunTgVYvAIbV+Z+8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/generator": "7.23.0", + "@babel/parser": "7.23.0", + "@babel/types": "7.23.0", + "@yao-pkg/pkg-fetch": "3.5.13", + "chalk": "^4.1.2", + "fs-extra": "^9.1.0", + "globby": "^11.1.0", + "into-stream": "^6.0.0", + "minimatch": "9.0.4", + "minimist": "^1.2.6", + "multistream": "^4.1.0", + "prebuild-install": "7.1.1", + "resolve": "^1.22.0", + "stream-meter": "^1.0.4" + }, + "bin": { + "pkg": "lib-es5/bin.js" + } + }, + "node_modules/@yao-pkg/pkg-fetch": { + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@yao-pkg/pkg-fetch/-/pkg-fetch-3.5.13.tgz", + "integrity": "sha512-KFIumJxNZIXoNKxJstSXbqQjdPqsxI4CKUGL/6GntsQ4U9bBAawkpkJh4s4vMUjGmx7otPvstdgYcO/3TerzzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "fs-extra": "^9.1.0", + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.6", + "progress": "^2.0.3", + "semver": "^7.3.5", + "tar-fs": "^2.1.1", + "yargs": "^16.2.0" + }, + "bin": { + "pkg-fetch": "lib-es5/bin.js" + } + }, + "node_modules/@yao-pkg/pkg-fetch/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/@yao-pkg/pkg-fetch/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@yao-pkg/pkg-fetch/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@yao-pkg/pkg-fetch/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/@yao-pkg/pkg/node_modules/@babel/generator": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.25.3", - "@vue/shared": "3.5.11", - "entities": "^4.5.0", - "estree-walker": "^2.0.2", - "source-map-js": "^1.2.0" + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@vue/compiler-dom": { - "version": "3.5.11", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.11.tgz", - "integrity": "sha512-pyGf8zdbDDRkBrEzf8p7BQlMKNNF5Fk/Cf/fQ6PiUz9at4OaUfyXW0dGJTo2Vl1f5U9jSLCNf0EZJEogLXoeew==", + "node_modules/@yao-pkg/pkg/node_modules/@babel/parser": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "license": "MIT", - "dependencies": { - "@vue/compiler-core": "3.5.11", - "@vue/shared": "3.5.11" + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" } }, - "node_modules/@vue/compiler-sfc": { - "version": "3.5.11", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.11.tgz", - "integrity": "sha512-gsbBtT4N9ANXXepprle+X9YLg2htQk1sqH/qGJ/EApl+dgpUBdTv3yP7YlR535uHZY3n6XaR0/bKo0BgwwDniw==", + "node_modules/@yao-pkg/pkg/node_modules/@babel/types": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.25.3", - "@vue/compiler-core": "3.5.11", - "@vue/compiler-dom": "3.5.11", - "@vue/compiler-ssr": "3.5.11", - "@vue/shared": "3.5.11", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.11", - "postcss": "^8.4.47", - "source-map-js": "^1.2.0" + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@vue/compiler-ssr": { - "version": "3.5.11", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.11.tgz", - "integrity": "sha512-P4+GPjOuC2aFTk1Z4WANvEhyOykcvEd5bIj2KVNGKGfM745LaXGr++5njpdBTzVz5pZifdlR1kpYSJJpIlSePA==", + "node_modules/@yao-pkg/pkg/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, "license": "MIT", "dependencies": { - "@vue/compiler-dom": "3.5.11", - "@vue/shared": "3.5.11" + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" } }, - "node_modules/@vue/shared": { - "version": "3.5.11", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.11.tgz", - "integrity": "sha512-W8GgysJVnFo81FthhzurdRAWP/byq3q2qIw70e0JWblzVhjgOMiC2GyovXrZTFQJnFVryYaKGP3Tc9vYzYm6PQ==", + "node_modules/@yao-pkg/pkg/node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, - "license": "MIT" + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@yao-pkg/pkg/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/acorn": { "version": "8.12.1", @@ -2184,12 +2761,12 @@ } }, "node_modules/axios": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.28.1.tgz", - "integrity": "sha512-iUcGA5a7p0mVb4Gm/sy+FSECNkPFT4y7wt6OM/CDpO/OnNCvSs3PoMG8ibrC9jRoGYU0gUK5pXVC4NPXq6lHRQ==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "license": "MIT", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -3202,6 +3779,45 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/esbuild": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -4014,16 +4630,6 @@ "dev": true, "license": "MIT" }, - "node_modules/has": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", - "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -5946,40 +6552,6 @@ "node": ">= 6" } }, - "node_modules/pkg": { - "version": "5.8.1", - "resolved": "https://registry.npmjs.org/pkg/-/pkg-5.8.1.tgz", - "integrity": "sha512-CjBWtFStCfIiT4Bde9QpJy0KeH19jCfwZRJqHFDFXfhUklCx8JoFmMj3wgnEYIwGmZVNkhsStPHEOnrtrQhEXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/generator": "7.18.2", - "@babel/parser": "7.18.4", - "@babel/types": "7.19.0", - "chalk": "^4.1.2", - "fs-extra": "^9.1.0", - "globby": "^11.1.0", - "into-stream": "^6.0.0", - "is-core-module": "2.9.0", - "minimist": "^1.2.6", - "multistream": "^4.1.0", - "pkg-fetch": "3.4.2", - "prebuild-install": "7.1.1", - "resolve": "^1.22.0", - "stream-meter": "^1.0.4" - }, - "bin": { - "pkg": "lib-es5/bin.js" - }, - "peerDependencies": { - "node-notifier": ">=9.0.1" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -6049,168 +6621,6 @@ "node": ">=8" } }, - "node_modules/pkg-fetch": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/pkg-fetch/-/pkg-fetch-3.4.2.tgz", - "integrity": "sha512-0+uijmzYcnhC0hStDjm/cl2VYdrmVVBpe7Q8k9YBojxmR5tG8mvR9/nooQq3QSXiQqORDVOTY3XqMEqJVIzkHA==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.2", - "fs-extra": "^9.1.0", - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.6", - "progress": "^2.0.3", - "semver": "^7.3.5", - "tar-fs": "^2.1.1", - "yargs": "^16.2.0" - }, - "bin": { - "pkg-fetch": "lib-es5/bin.js" - } - }, - "node_modules/pkg-fetch/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/pkg-fetch/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/pkg-fetch/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/pkg-fetch/node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/pkg/node_modules/@babel/generator": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.2.tgz", - "integrity": "sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.18.2", - "@jridgewell/gen-mapping": "^0.3.0", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/pkg/node_modules/@babel/parser": { - "version": "7.18.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.4.tgz", - "integrity": "sha512-FDge0dFazETFcxGw/EXzOkN8uJp0PC7Qbm+Pe9T+av2zlBpOgunFHkQPPn+eRuClU73JF+98D531UgayY89tow==", - "dev": true, - "license": "MIT", - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/pkg/node_modules/@babel/types": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.0.tgz", - "integrity": "sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.18.6", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/pkg/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/pkg/node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", - "dev": true, - "license": "MIT", - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/pkg/node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/please-upgrade-node": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", diff --git a/package.json b/package.json index 8acadf8f3..10711bcc9 100644 --- a/package.json +++ b/package.json @@ -1,30 +1,31 @@ { + "type": "module", "name": "gitlab-ci-local", "description": "Tired of pushing to test your .gitlab-ci.yml?", "main": "src/index.js", "bin": "src/index.js", "version": "4.54.0", "scripts": { - "pkg-linux": "pkg src/index.js --public -t node18-linux-x64 -o bin/linux/gitlab-ci-local && chmod +x bin/linux/gitlab-ci-local && gzip -c bin/linux/gitlab-ci-local > bin/linux.gz", - "pkg-macos": "pkg src/index.js --public -t node18-macos-x64 -o bin/macos/gitlab-ci-local && gzip -c bin/macos/gitlab-ci-local > bin/macos.gz", - "pkg-win": "pkg src/index.js --public -t node18-win-x64 -o bin/win/gitlab-ci-local && gzip -c bin/win/gitlab-ci-local.exe > bin/win.gz", + "esbuild": "esbuild src/index.ts --outfile=bin/index.cjs --bundle --platform=node --format=cjs --minify --external:yargs --sourcemap=inline", + "pkg-linux": "pkg bin/index.cjs --public -t node20-linux-x64 -o bin/linux/gitlab-ci-local && chmod +x bin/linux/gitlab-ci-local && gzip -c bin/linux/gitlab-ci-local > bin/linux.gz", + "pkg-macos": "pkg bin/index.cjs --public -t node20-macos-x64 -o bin/macos/gitlab-ci-local && gzip -c bin/macos/gitlab-ci-local > bin/macos.gz", + "pkg-win": "pkg bin/index.cjs --public -t node20-win-x64 -o bin/win/gitlab-ci-local && gzip -c bin/win/gitlab-ci-local.exe > bin/win.gz", "pkg-all": "npm run pkg-linux && npm run pkg-macos && npm run pkg-win", - "pkg": "pkg", "cleanup": "git clean -fX tests/ && git clean -fX src/", "build": " npm run cleanup && tsc", "check-all": "npm run build && npm run lint && npm run coverage && npm run audit", "audit": "npm audit --parseable", "lint": "npx eslint .", - "test": "npm run build && jest --testTimeout 60000", - "test-except-dind": "npm run build && jest --testTimeout 60000 --testPathIgnorePatterns=dind", - "coverage": "jest --coverage --testTimeout 60000", - "start": "ts-node --log-error src/index.ts --cwd examples/docker-compose-nodejs", - "dev": "touch .gitlab-ci.yml && nodemon -e ts --watch src --watch .gitlab-ci.yml --exec ts-node src/index.ts", + "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --testTimeout 60000", + "test-except-dind": "npm run test -- --testPathIgnorePatterns=\"/dind.*/|/node_modules/|/.gitlab-ci-local/\"", + "coverage": "npm run build && FORCE_COLOR=1 npm run test -- --coverage --verbose", + "start": "NODE_OPTIONS='--loader ts-node/esm' ts-node --log-error src/index.ts --cwd examples/docker-compose-nodejs", + "dev": "touch .gitlab-ci.yml && NODE_OPTIONS='--loader ts-node/esm' nodemon -e ts --watch src --watch .gitlab-ci.yml --exec ts-node src/index.ts", "fetch-and-patch-schema": "curl https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json -sf | jq 'del(.. | .pattern?)' > src/schema/schema.json" }, "dependencies": { "ajv": "8.x.x", - "axios": "0.28.x", + "axios": "^1.7.7", "base64url": "3.x.x", "camelcase": "6.x.x", "chalk": "4.x.x", @@ -61,13 +62,14 @@ "@types/yargs": "17.x.x", "@typescript-eslint/eslint-plugin": "7.x.x", "@typescript-eslint/parser": "7.x.x", + "@yao-pkg/pkg": "^5.15.0", "axios-mock-adapter": "2.x", "depcheck": "1.x.x", + "esbuild": "^0.23.1", "eslint": "8.x.x", "jest": "29.x.x", "jest-when": "3.x.x", "nodemon": "^3.1.1", - "pkg": "5.x.x", "ts-jest": "29.x.x", "ts-node": "10.x.x", "typescript": "5.x.x" @@ -132,6 +134,18 @@ } }, "jest": { + "extensionsToTreatAsEsm": [ + ".ts" + ], + "transform": { + "^.+\\.tsx?$": [ + "ts-jest", + { + "useESM": true + } + ], + "^.+\\.jsx?$": "babel-jest" + }, "preset": "ts-jest", "testMatch": [ "**/*.test.ts" @@ -140,6 +154,9 @@ "/node_modules/", "/.gitlab-ci-local/" ], + "moduleNameMapper": { + "(.+)\\.js": "$1" + }, "coverageReporters": [ "lcov", "json-summary", diff --git a/src/argv.ts b/src/argv.ts index 931c79423..5e7028936 100644 --- a/src/argv.ts +++ b/src/argv.ts @@ -1,10 +1,10 @@ import assert from "assert"; -import * as fs from "fs-extra"; +import fs from "fs-extra"; import * as dotenv from "dotenv"; import * as path from "path"; import camelCase from "camelcase"; -import {Utils} from "./utils"; -import {WriteStreams} from "./write-streams"; +import {Utils} from "./utils.js"; +import {WriteStreams} from "./write-streams.js"; import chalk from "chalk"; async function isInGitRepository () { diff --git a/src/commander.ts b/src/commander.ts index 80ce74d97..4fbbe2a44 100644 --- a/src/commander.ts +++ b/src/commander.ts @@ -1,11 +1,11 @@ import chalk from "chalk"; -import {Job} from "./job"; -import {Parser} from "./parser"; -import {Utils} from "./utils"; -import {WriteStreams} from "./write-streams"; -import {Executor} from "./executor"; +import {Job} from "./job.js"; +import {Parser} from "./parser.js"; +import {Utils} from "./utils.js"; +import {WriteStreams} from "./write-streams.js"; +import {Executor} from "./executor.js"; import fs from "fs-extra"; -import {Argv} from "./argv"; +import {Argv} from "./argv.js"; import {AssertionError} from "assert"; export class Commander { diff --git a/src/data-expander.ts b/src/data-expander.ts index 4b91c357b..a9f11ba38 100644 --- a/src/data-expander.ts +++ b/src/data-expander.ts @@ -1,9 +1,9 @@ import chalk from "chalk"; import deepExtend from "deep-extend"; import assert, {AssertionError} from "assert"; -import {Job, Need} from "./job"; +import {Job, Need} from "./job.js"; import {traverse} from "object-traversal"; -import {Utils} from "./utils"; +import {Utils} from "./utils.js"; const extendsMaxDepth = 11; const extendsRecurse = (gitlabData: any, jobName: string, jobData: any, parents: any[], depth: number) => { diff --git a/src/executor.ts b/src/executor.ts index cba09c41e..db70300d3 100644 --- a/src/executor.ts +++ b/src/executor.ts @@ -1,7 +1,7 @@ import chalk from "chalk"; -import {Job} from "./job"; +import {Job} from "./job.js"; import assert, {AssertionError} from "assert"; -import {Argv} from "./argv"; +import {Argv} from "./argv.js"; import pMap from "p-map"; export class Executor { diff --git a/src/git-data.ts b/src/git-data.ts index 9c0e2882d..b32b5d5df 100644 --- a/src/git-data.ts +++ b/src/git-data.ts @@ -1,6 +1,6 @@ -import {Utils} from "./utils"; +import {Utils} from "./utils.js"; import assert, {AssertionError} from "assert"; -import {WriteStreams} from "./write-streams"; +import {WriteStreams} from "./write-streams.js"; import chalk from "chalk"; export type GitSchema = "git" | "http" | "https" | "ssh"; diff --git a/src/handler.ts b/src/handler.ts index a18534b2e..e04530e2b 100644 --- a/src/handler.ts +++ b/src/handler.ts @@ -1,16 +1,16 @@ import * as yaml from "js-yaml"; import chalk from "chalk"; import path from "path"; -import * as fs from "fs-extra"; -import * as yargs from "yargs"; -import {Commander} from "./commander"; -import {Parser} from "./parser"; -import * as state from "./state"; +import fs from "fs-extra"; +import yargs from "yargs"; +import {Commander} from "./commander.js"; +import {Parser} from "./parser.js"; +import * as state from "./state.js"; import prettyHrtime from "pretty-hrtime"; -import {WriteStreams} from "./write-streams"; -import {cleanupJobResources, Job} from "./job"; -import {Utils} from "./utils"; -import {Argv} from "./argv"; +import {WriteStreams} from "./write-streams.js"; +import {cleanupJobResources, Job} from "./job.js"; +import {Utils} from "./utils.js"; +import {Argv} from "./argv.js"; import assert from "assert"; const generateGitIgnore = (cwd: string, stateDir: string) => { @@ -29,7 +29,7 @@ export async function handler (args: any, writeStreams: WriteStreams, jobs: Job[ let parser: Parser | null = null; if (argv.completion) { - yargs.showCompletionScript(); + yargs(process.argv.slice(2)).showCompletionScript(); return []; } diff --git a/src/index.ts b/src/index.ts index 5266b3966..e2a6ed1a9 100755 --- a/src/index.ts +++ b/src/index.ts @@ -1,18 +1,17 @@ #!/usr/bin/env node -import "source-map-support/register"; +import "source-map-support/register.js"; import chalk from "chalk"; -import * as fs from "fs-extra"; -import * as path from "path"; import yargs from "yargs"; -import {Parser} from "./parser"; -import * as state from "./state"; -import {WriteStreamsProcess, WriteStreamsMock} from "./write-streams"; -import {handler} from "./handler"; -import {Executor} from "./executor"; -import {Argv} from "./argv"; +import {Parser} from "./parser.js"; +import * as state from "./state.js"; +import {WriteStreamsProcess, WriteStreamsMock} from "./write-streams.js"; +import {handler} from "./handler.js"; +import {Executor} from "./executor.js"; +import {Argv} from "./argv.js"; import {AssertionError} from "assert"; -import {Job, cleanupJobResources} from "./job"; -import {GitlabRunnerPresetValues} from "./gitlab-preset"; +import {Job, cleanupJobResources} from "./job.js"; +import {GitlabRunnerPresetValues} from "./gitlab-preset.js"; +import packageJson from "../package.json" with { type: "json" }; const jobs: Job[] = []; @@ -25,12 +24,11 @@ process.on("SIGINT", async (_: string, code: number) => { process.on("SIGUSR2", async () => await cleanupJobResources(jobs)); (() => { - const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, "../package.json"), "utf8")); - yargs(process.argv.slice(2)) - .parserConfiguration({"greedy-arrays": false}) + const yparser = yargs(process.argv.slice(2)); + yparser.parserConfiguration({"greedy-arrays": false}) .showHelpOnFail(false) .version(packageJson["version"]) - .wrap(yargs.terminalWidth?.()) + .wrap(yparser.terminalWidth?.()) .command({ handler: async (argv) => { try { diff --git a/src/job.ts b/src/job.ts index 899bc707b..92ee221ec 100644 --- a/src/job.ts +++ b/src/job.ts @@ -1,17 +1,17 @@ import chalk from "chalk"; import * as dotenv from "dotenv"; -import * as fs from "fs-extra"; +import fs from "fs-extra"; import prettyHrtime from "pretty-hrtime"; import split2 from "split2"; -import {Utils} from "./utils"; -import {WriteStreams} from "./write-streams"; -import {GitData} from "./git-data"; +import {Utils} from "./utils.js"; +import {WriteStreams} from "./write-streams.js"; +import {GitData} from "./git-data.js"; import assert, {AssertionError} from "assert"; -import {Mutex} from "./mutex"; -import {Argv} from "./argv"; +import {Mutex} from "./mutex.js"; +import {Argv} from "./argv.js"; import execa from "execa"; -import {CICDVariable} from "./variables-from-files"; -import {GitlabRunnerCPUsPresetValue, GitlabRunnerMemoryPresetValue, GitlabRunnerPresetValues} from "./gitlab-preset"; +import {CICDVariable} from "./variables-from-files.js"; +import {GitlabRunnerCPUsPresetValue, GitlabRunnerMemoryPresetValue, GitlabRunnerPresetValues} from "./gitlab-preset.js"; const CI_PROJECT_DIR = "/gcl-builds"; interface JobOptions { diff --git a/src/parser-includes.ts b/src/parser-includes.ts index f43f41579..37e2ac360 100644 --- a/src/parser-includes.ts +++ b/src/parser-includes.ts @@ -1,10 +1,10 @@ -import {Utils} from "./utils"; +import {Utils} from "./utils.js"; import fs from "fs-extra"; -import {WriteStreams} from "./write-streams"; -import {GitData} from "./git-data"; +import {WriteStreams} from "./write-streams.js"; +import {GitData} from "./git-data.js"; import assert, {AssertionError} from "assert"; import chalk from "chalk"; -import {Parser} from "./parser"; +import {Parser} from "./parser.js"; import axios from "axios"; import globby from "globby"; import path from "path"; @@ -219,7 +219,7 @@ export class ParserIncludes { try { const target = `${cwd}/${stateDir}/includes/${fsUrl}`; if (await fs.pathExists(target) && !fetchIncludes) return; - const res = await axios.get(url); + const res = await axios.get(url, {headers: {"User-Agent": "gitlab-ci-local"}}); await fs.outputFile(target, res.data); } catch (e) { throw new AssertionError({message: `Remote include could not be fetched ${url}\n${e}`}); diff --git a/src/parser.ts b/src/parser.ts index 02f67f8ac..ca95e4290 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -1,22 +1,22 @@ import chalk from "chalk"; import path from "path"; import deepExtend from "deep-extend"; -import * as fs from "fs-extra"; +import fs from "fs-extra"; import * as yaml from "js-yaml"; import prettyHrtime from "pretty-hrtime"; -import {Job} from "./job"; -import * as DataExpander from "./data-expander"; -import {Utils} from "./utils"; +import {Job} from "./job.js"; +import * as DataExpander from "./data-expander.js"; +import {Utils} from "./utils.js"; import assert from "assert"; -import {Validator} from "./validator"; -import * as parallel from "./parallel"; -import {GitData} from "./git-data"; -import {ParserIncludes} from "./parser-includes"; -import {Producers} from "./producers"; -import {VariablesFromFiles} from "./variables-from-files"; -import {Argv} from "./argv"; -import {WriteStreams} from "./write-streams"; -import {init as initPredefinedVariables} from "./predefined-variables"; +import {Validator} from "./validator.js"; +import * as parallel from "./parallel.js"; +import {GitData} from "./git-data.js"; +import {ParserIncludes} from "./parser-includes.js"; +import {Producers} from "./producers.js"; +import {VariablesFromFiles} from "./variables-from-files.js"; +import {Argv} from "./argv.js"; +import {WriteStreams} from "./write-streams.js"; +import {init as initPredefinedVariables} from "./predefined-variables.js"; const MAX_FUNCTIONS = 3; const INCLUDE_INPUTS_SUPPORTED_TYPES = ["string", "boolean", "number", "array"] as const; diff --git a/src/predefined-variables.ts b/src/predefined-variables.ts index 02ade0bf1..94e0e6a86 100644 --- a/src/predefined-variables.ts +++ b/src/predefined-variables.ts @@ -1,5 +1,5 @@ import camelCase from "camelcase"; -import {GitData} from "./git-data"; +import {GitData} from "./git-data.js"; type PredefinedVariablesOpts = { gitData: GitData; diff --git a/src/producers.ts b/src/producers.ts index e0f1472fd..f75433cbc 100644 --- a/src/producers.ts +++ b/src/producers.ts @@ -1,5 +1,5 @@ -import {Utils} from "./utils"; -import {Job} from "./job"; +import {Utils} from "./utils.js"; +import {Job} from "./job.js"; export class Producers { diff --git a/src/schema/index.ts b/src/schema/index.ts index 39245f708..52db0fdb0 100644 --- a/src/schema/index.ts +++ b/src/schema/index.ts @@ -1,15 +1,16 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires -const schema = require("./schema.json"); +import _schema from "./schema.json" with { type: "json" }; -schema.definitions.job_template.properties.gclArtifactsToSource = { +const schema: any = _schema; +schema.definitions.job_template.properties.gclInjectSSHAgent = { "type": "boolean", }; schema.definitions.job_template.properties.gclInteractive = { "type": "boolean", }; -schema.definitions.job_template.properties.gclInjectSSHAgent = { +schema.definitions.job_template.properties.gclArtifactsToSource = { "type": "boolean", }; + schema.definitions.job_template.properties.gclDescription = { "type": "string", }; diff --git a/src/state.ts b/src/state.ts index 9ca315bcb..26a4ad35f 100644 --- a/src/state.ts +++ b/src/state.ts @@ -1,4 +1,4 @@ -import * as fs from "fs-extra"; +import fs from "fs-extra"; import * as yaml from "js-yaml"; const loadStateYML = async (stateFile: string): Promise => { diff --git a/src/utils.ts b/src/utils.ts index 19b6ad5fc..d86800874 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,12 +1,12 @@ import chalk from "chalk"; -import {Job, JobRule} from "./job"; -import * as fs from "fs-extra"; +import {Job, JobRule} from "./job.js"; +import fs from "fs-extra"; import checksum from "checksum"; import base64url from "base64url"; import execa from "execa"; import assert from "assert"; -import {CICDVariable} from "./variables-from-files"; -import {GitData, GitSchema} from "./git-data"; +import {CICDVariable} from "./variables-from-files.js"; +import {GitData, GitSchema} from "./git-data.js"; import globby from "globby"; import micromatch from "micromatch"; import axios from "axios"; @@ -257,7 +257,7 @@ Refer to https://docs.gitlab.com/ee/ci/jobs/job_rules.html#unexpected-behavior-f let res; try { - res = eval(evalStr); + res = (0, eval)(evalStr); // https://esbuild.github.io/content-types/#direct-eval } catch (err) { console.log(` Error attempting to evaluate the following rules: diff --git a/src/validator.ts b/src/validator.ts index a98127e20..e258f4c02 100644 --- a/src/validator.ts +++ b/src/validator.ts @@ -1,9 +1,9 @@ import Ajv from "ajv"; -import {Job} from "./job"; +import {Job} from "./job.js"; import assert from "assert"; import chalk from "chalk"; -import schema from "./schema"; -import {betterAjvErrors} from "./schema-error"; +import schema from "./schema/index.js"; +import {betterAjvErrors} from "./schema-error.js"; import terminalLink from "terminal-link"; const MAX_ERRORS = 5; diff --git a/src/variables-from-files.ts b/src/variables-from-files.ts index cc5d472ca..4c301e7af 100644 --- a/src/variables-from-files.ts +++ b/src/variables-from-files.ts @@ -1,11 +1,11 @@ -import {WriteStreams} from "./write-streams"; -import {GitData} from "./git-data"; -import * as fs from "fs-extra"; +import {WriteStreams} from "./write-streams.js"; +import {GitData} from "./git-data.js"; +import fs from "fs-extra"; import * as yaml from "js-yaml"; import chalk from "chalk"; -import {Argv} from "./argv"; +import {Argv} from "./argv.js"; import assert from "assert"; -import {Utils} from "./utils"; +import {Utils} from "./utils.js"; export interface CICDVariable { type: "file" | "variable"; diff --git a/tests/cases.test.ts b/tests/cases.test.ts index e548b2105..420ad97a2 100644 --- a/tests/cases.test.ts +++ b/tests/cases.test.ts @@ -1,6 +1,6 @@ -import {WriteStreamsMock} from "../src/write-streams"; +import {WriteStreamsMock} from "../src/write-streams.js"; import chalk from "chalk"; -import {handler} from "../src/handler"; +import {handler} from "../src/handler.js"; import assert from "assert"; import {AssertionError} from "assert"; import fs from "fs-extra"; @@ -15,7 +15,7 @@ afterAll(() => { }); test("--completion", async () => { - const spy = jest.spyOn(console, "log").mockImplementation(); + const spy = import.meta.jest.spyOn(console, "log").mockImplementation(); const writeStreams = new WriteStreamsMock(); await handler({ completion: true, diff --git a/tests/expand.test.ts b/tests/expand.test.ts index b02778f0d..0e9fea304 100644 --- a/tests/expand.test.ts +++ b/tests/expand.test.ts @@ -1,6 +1,6 @@ import chalk from "chalk"; -import * as DataExpander from "../src/data-expander"; -import {Utils} from "../src/utils"; +import * as DataExpander from "../src/data-expander.js"; +import {Utils} from "../src/utils.js"; import assert from "assert"; import {AssertionError} from "assert"; diff --git a/tests/git-data.test.ts b/tests/git-data.test.ts index 51b5beae4..92c5ab35a 100644 --- a/tests/git-data.test.ts +++ b/tests/git-data.test.ts @@ -1,6 +1,6 @@ -import {GitData} from "../src/git-data"; -import {WriteStreamsMock} from "../src/write-streams"; -import {initSpawnSpy, initSpawnSpyReject} from "./mocks/utils.mock"; +import {GitData} from "../src/git-data.js"; +import {WriteStreamsMock} from "../src/write-streams.js"; +import {initSpawnSpy, initSpawnSpyReject} from "./mocks/utils.mock.js"; const tests = [ diff --git a/tests/mocks/utils.mock.ts b/tests/mocks/utils.mock.ts index 533be6b79..69087f568 100644 --- a/tests/mocks/utils.mock.ts +++ b/tests/mocks/utils.mock.ts @@ -1,8 +1,8 @@ import {when} from "jest-when"; -import {Utils} from "../../src/utils"; +import {Utils} from "../../src/utils.js"; export function initBashSpyReject (spyMocks: {cmd: string; rejection: any}[]) { - const spyOn = jest.spyOn(Utils, "bash"); + const spyOn = import.meta.jest.spyOn(Utils, "bash"); for (const spyMock of spyMocks) { when(spyOn).calledWith(spyMock.cmd, expect.any(String)).mockRejectedValue(spyMock.rejection); @@ -11,7 +11,7 @@ export function initBashSpyReject (spyMocks: {cmd: string; rejection: any}[]) { } export function initBashSpy (spyMocks: {cmd: string; returnValue: any}[]) { - const spyOn = jest.spyOn(Utils, "bash"); + const spyOn = import.meta.jest.spyOn(Utils, "bash"); for (const spyMock of spyMocks) { when(spyOn).calledWith(spyMock.cmd, expect.any(String)).mockResolvedValue(spyMock.returnValue); @@ -22,7 +22,7 @@ export function initBashSpy (spyMocks: {cmd: string; returnValue: any}[]) { } export function initSyncSpawnSpy (spyMocks: {cmdArgs: string[]; returnValue: any}[]) { - const spyOn = jest.spyOn(Utils, "syncSpawn"); + const spyOn = import.meta.jest.spyOn(Utils, "syncSpawn"); for (const spyMock of spyMocks) { when(spyOn).calledWith(spyMock.cmdArgs, expect.any(String)).mockReturnValue(spyMock.returnValue); @@ -31,7 +31,7 @@ export function initSyncSpawnSpy (spyMocks: {cmdArgs: string[]; returnValue: any } export function initSpawnSpy (spyMocks: {cmdArgs: string[]; returnValue: any}[]) { - const spyOn = jest.spyOn(Utils, "spawn"); + const spyOn = import.meta.jest.spyOn(Utils, "spawn"); for (const spyMock of spyMocks) { when(spyOn).calledWith(spyMock.cmdArgs, expect.any(String)).mockResolvedValue(spyMock.returnValue); @@ -42,7 +42,7 @@ export function initSpawnSpy (spyMocks: {cmdArgs: string[]; returnValue: any}[]) } export function initSpawnSpyReject (spyMocks: {cmdArgs: string[]; rejection: any}[]) { - const spyOn = jest.spyOn(Utils, "spawn"); + const spyOn = import.meta.jest.spyOn(Utils, "spawn"); for (const spyMock of spyMocks) { when(spyOn).calledWith(spyMock.cmdArgs, expect.any(String)).mockRejectedValue(spyMock.rejection); diff --git a/tests/print-funcs.test.ts b/tests/print-funcs.test.ts index a11d4185d..dcb35d686 100644 --- a/tests/print-funcs.test.ts +++ b/tests/print-funcs.test.ts @@ -1,5 +1,5 @@ -import {Utils} from "../src/utils"; -import {WriteStreamsMock} from "../src/write-streams"; +import {Utils} from "../src/utils.js"; +import {WriteStreamsMock} from "../src/write-streams.js"; test("Print job on first index", () => { const writeStreams = new WriteStreamsMock(); diff --git a/tests/process-write-streams.test.ts b/tests/process-write-streams.test.ts index a2c947cb4..d43837b10 100644 --- a/tests/process-write-streams.test.ts +++ b/tests/process-write-streams.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsProcess} from "../src/write-streams"; +import {WriteStreamsProcess} from "../src/write-streams.js"; -const spyStdout = jest.spyOn(process.stdout, "write").mockImplementation(); -const spyStderr = jest.spyOn(process.stderr, "write").mockImplementation(); +const spyStdout = import.meta.jest.spyOn(process.stdout, "write").mockImplementation(); +const spyStderr = import.meta.jest.spyOn(process.stderr, "write").mockImplementation(); afterEach(() => { spyStdout.mockClear(); diff --git a/tests/rules-regex.test.ts b/tests/rules-regex.test.ts index 8ad4c65c3..476b1cc8b 100644 --- a/tests/rules-regex.test.ts +++ b/tests/rules-regex.test.ts @@ -9,7 +9,7 @@ let gitData: GitData; beforeEach(async () => { writeStreams = new WriteStreamsMock(); gitData = await GitData.init("tests", writeStreams); - jest.clearAllMocks(); + import.meta.jest.clearAllMocks(); }); /* eslint-disable @typescript-eslint/quotes */ @@ -85,8 +85,8 @@ describe("gitlab rules regex", () => { .forEach((t) => { test(`- if: '${t.rule}'\n\t => ${t.evalResult}`, async () => { const rules = [ {if: t.rule} ]; - const evalSpy = jest.spyOn(global, "eval"); - const evaluateRuleIfSpy = jest.spyOn(Utils, "evaluateRuleIf"); + const evalSpy = import.meta.jest.spyOn(global, "eval"); + const evaluateRuleIfSpy = import.meta.jest.spyOn(Utils, "evaluateRuleIf"); Utils.getRulesResult({cwd: "", rules, variables: {}}, gitData); expect(evalSpy).toHaveBeenCalledWith(t.jsExpression); diff --git a/tests/rules.test.ts b/tests/rules.test.ts index c1936ac5c..52044f00d 100644 --- a/tests/rules.test.ts +++ b/tests/rules.test.ts @@ -1,6 +1,6 @@ -import {Utils} from "../src/utils"; -import {GitData} from "../src/git-data"; -import {WriteStreamsMock} from "../src/write-streams"; +import {Utils} from "../src/utils.js"; +import {GitData} from "../src/git-data.js"; +import {WriteStreamsMock} from "../src/write-streams.js"; let writeStreams; let gitData: GitData; diff --git a/tests/test-cases/after-script/integration.after-script.test.ts b/tests/test-cases/after-script/integration.after-script.test.ts index cea2665a3..460600d34 100644 --- a/tests/test-cases/after-script/integration.after-script.test.ts +++ b/tests/test-cases/after-script/integration.after-script.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/argv-cwd/integration.artifacts-after-afterscript.test.ts b/tests/test-cases/argv-cwd/integration.artifacts-after-afterscript.test.ts index db7f7e03b..6d70cd3cc 100644 --- a/tests/test-cases/argv-cwd/integration.artifacts-after-afterscript.test.ts +++ b/tests/test-cases/argv-cwd/integration.artifacts-after-afterscript.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; -import {Utils} from "../../../src/utils"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; +import {Utils} from "../../../src/utils.js"; import fs from "fs-extra"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; diff --git a/tests/test-cases/artifacts-after-afterscript/integration.artifacts-after-afterscript.test.ts b/tests/test-cases/artifacts-after-afterscript/integration.artifacts-after-afterscript.test.ts index f44fb6f1f..bd68b6821 100644 --- a/tests/test-cases/artifacts-after-afterscript/integration.artifacts-after-afterscript.test.ts +++ b/tests/test-cases/artifacts-after-afterscript/integration.artifacts-after-afterscript.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; beforeAll(() => { diff --git a/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts b/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts index f3e69ba63..5bd48d351 100644 --- a/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts +++ b/tests/test-cases/artifacts-docker/integration.artifacts-docker.test.ts @@ -1,11 +1,11 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; import chalk from "chalk"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-dotenv/integration.artifacts-dotenv.test.ts b/tests/test-cases/artifacts-dotenv/integration.artifacts-dotenv.test.ts index f206af6d0..209be157d 100644 --- a/tests/test-cases/artifacts-dotenv/integration.artifacts-dotenv.test.ts +++ b/tests/test-cases/artifacts-dotenv/integration.artifacts-dotenv.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-exclude/integration.artifacts-exclude.test.ts b/tests/test-cases/artifacts-exclude/integration.artifacts-exclude.test.ts index 1b99ee245..99630d216 100644 --- a/tests/test-cases/artifacts-exclude/integration.artifacts-exclude.test.ts +++ b/tests/test-cases/artifacts-exclude/integration.artifacts-exclude.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-globstar/integration.artifacts-globstar.test.ts b/tests/test-cases/artifacts-globstar/integration.artifacts-globstar.test.ts index 1314e5feb..c22882662 100644 --- a/tests/test-cases/artifacts-globstar/integration.artifacts-globstar.test.ts +++ b/tests/test-cases/artifacts-globstar/integration.artifacts-globstar.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-no-shell-out/integration.artifacts-no-shell-out.test.ts b/tests/test-cases/artifacts-no-shell-out/integration.artifacts-no-shell-out.test.ts index 5f09177ee..0f2b6282a 100644 --- a/tests/test-cases/artifacts-no-shell-out/integration.artifacts-no-shell-out.test.ts +++ b/tests/test-cases/artifacts-no-shell-out/integration.artifacts-no-shell-out.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-reports-dotenv/integration.artifacts-reports-dotenv.test.ts b/tests/test-cases/artifacts-reports-dotenv/integration.artifacts-reports-dotenv.test.ts index 3de236025..5c07ac274 100644 --- a/tests/test-cases/artifacts-reports-dotenv/integration.artifacts-reports-dotenv.test.ts +++ b/tests/test-cases/artifacts-reports-dotenv/integration.artifacts-reports-dotenv.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-sequence/integration.artifacts-sequence.test.ts b/tests/test-cases/artifacts-sequence/integration.artifacts-sequence.test.ts index 4481ec8cc..bdba1fe6d 100644 --- a/tests/test-cases/artifacts-sequence/integration.artifacts-sequence.test.ts +++ b/tests/test-cases/artifacts-sequence/integration.artifacts-sequence.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-shell-fail-always/integration.artifacts-shell-fail-always.test.ts b/tests/test-cases/artifacts-shell-fail-always/integration.artifacts-shell-fail-always.test.ts index 98f2636af..19f65c34d 100644 --- a/tests/test-cases/artifacts-shell-fail-always/integration.artifacts-shell-fail-always.test.ts +++ b/tests/test-cases/artifacts-shell-fail-always/integration.artifacts-shell-fail-always.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-shell-fail/integration.artifacts-shell-fail.test.ts b/tests/test-cases/artifacts-shell-fail/integration.artifacts-shell-fail.test.ts index 0de994449..b26902e00 100644 --- a/tests/test-cases/artifacts-shell-fail/integration.artifacts-shell-fail.test.ts +++ b/tests/test-cases/artifacts-shell-fail/integration.artifacts-shell-fail.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/artifacts-shell/integration.artifacts-shell.test.ts b/tests/test-cases/artifacts-shell/integration.artifacts-shell.test.ts index e2c123a92..acc42c7ba 100644 --- a/tests/test-cases/artifacts-shell/integration.artifacts-shell.test.ts +++ b/tests/test-cases/artifacts-shell/integration.artifacts-shell.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/artifacts-to-source-no/integration.artifacts-to-source-no.test.ts b/tests/test-cases/artifacts-to-source-no/integration.artifacts-to-source-no.test.ts index db0a95241..76f53a7d8 100644 --- a/tests/test-cases/artifacts-to-source-no/integration.artifacts-to-source-no.test.ts +++ b/tests/test-cases/artifacts-to-source-no/integration.artifacts-to-source-no.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/artifacts-with-cache/integration.artifacts-with-cache.test.ts b/tests/test-cases/artifacts-with-cache/integration.artifacts-with-cache.test.ts index b013260d6..92eb01258 100644 --- a/tests/test-cases/artifacts-with-cache/integration.artifacts-with-cache.test.ts +++ b/tests/test-cases/artifacts-with-cache/integration.artifacts-with-cache.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/before-script-default/integration.before-script-default.test.ts b/tests/test-cases/before-script-default/integration.before-script-default.test.ts index 0f8f6578f..129c7cc03 100644 --- a/tests/test-cases/before-script-default/integration.before-script-default.test.ts +++ b/tests/test-cases/before-script-default/integration.before-script-default.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/before-script/integration.before-script.test.ts b/tests/test-cases/before-script/integration.before-script.test.ts index 16de592fa..b8e9946b5 100644 --- a/tests/test-cases/before-script/integration.before-script.test.ts +++ b/tests/test-cases/before-script/integration.before-script.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-conditional-policy/integration.cache-conditional-policy.test.ts b/tests/test-cases/cache-conditional-policy/integration.cache-conditional-policy.test.ts index 5be2f6c4d..1e8049d0b 100644 --- a/tests/test-cases/cache-conditional-policy/integration.cache-conditional-policy.test.ts +++ b/tests/test-cases/cache-conditional-policy/integration.cache-conditional-policy.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/cache-directives/integration.cache-directives.test.ts b/tests/test-cases/cache-directives/integration.cache-directives.test.ts index 5b17578d0..cf7288925 100644 --- a/tests/test-cases/cache-directives/integration.cache-directives.test.ts +++ b/tests/test-cases/cache-directives/integration.cache-directives.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts b/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts index 13ea22df7..e66cfff83 100644 --- a/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts +++ b/tests/test-cases/cache-docker-mount-globstar/integration.cache-docker-mount-invalid.test.ts @@ -1,11 +1,11 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert, {AssertionError} from "assert"; import chalk from "chalk"; -jest.setTimeout(30000); +import.meta.jest.setTimeout(30000); beforeAll(() => { const spyGitRemote = { diff --git a/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts b/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts index f6fe7ca24..ee3772c3d 100644 --- a/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts +++ b/tests/test-cases/cache-docker-mount/integration.cache-docker-mount.test.ts @@ -1,11 +1,11 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; -import {Utils} from "../../../src/utils"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; +import {Utils} from "../../../src/utils.js"; -jest.setTimeout(45000); +import.meta.jest.setTimeout(45000); beforeAll(() => { const spyGitRemote = { diff --git a/tests/test-cases/cache-docker/integration.cache-docker.test.ts b/tests/test-cases/cache-docker/integration.cache-docker.test.ts index 517b308ec..f14ae2938 100644 --- a/tests/test-cases/cache-docker/integration.cache-docker.test.ts +++ b/tests/test-cases/cache-docker/integration.cache-docker.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-double-run/integration.cache-double-run.test.ts b/tests/test-cases/cache-double-run/integration.cache-double-run.test.ts index 347ec14e0..8905cb0e5 100644 --- a/tests/test-cases/cache-double-run/integration.cache-double-run.test.ts +++ b/tests/test-cases/cache-double-run/integration.cache-double-run.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-key-files/integration.key-files.test.ts b/tests/test-cases/cache-key-files/integration.key-files.test.ts index 13d99b3f9..62bff12f7 100644 --- a/tests/test-cases/cache-key-files/integration.key-files.test.ts +++ b/tests/test-cases/cache-key-files/integration.key-files.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/cache-key-invalid-files/integration.key-invalid-files.test.ts b/tests/test-cases/cache-key-invalid-files/integration.key-invalid-files.test.ts index 60d2b092e..a25d183de 100644 --- a/tests/test-cases/cache-key-invalid-files/integration.key-invalid-files.test.ts +++ b/tests/test-cases/cache-key-invalid-files/integration.key-invalid-files.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import {AssertionError} from "assert"; beforeAll(() => { diff --git a/tests/test-cases/cache-paths-not-array/integration.cache-paths-not-array.test.ts b/tests/test-cases/cache-paths-not-array/integration.cache-paths-not-array.test.ts index eb3dc4a74..66841800b 100644 --- a/tests/test-cases/cache-paths-not-array/integration.cache-paths-not-array.test.ts +++ b/tests/test-cases/cache-paths-not-array/integration.cache-paths-not-array.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/cache-paths-undefined-array/integration.cache-paths-undefined-array.test.ts b/tests/test-cases/cache-paths-undefined-array/integration.cache-paths-undefined-array.test.ts index 1a7366460..07dbcb61a 100644 --- a/tests/test-cases/cache-paths-undefined-array/integration.cache-paths-undefined-array.test.ts +++ b/tests/test-cases/cache-paths-undefined-array/integration.cache-paths-undefined-array.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/cache-shell-fail/integration.cache-shell-fail.test.ts b/tests/test-cases/cache-shell-fail/integration.cache-shell-fail.test.ts index d7d32da4e..562c47e16 100644 --- a/tests/test-cases/cache-shell-fail/integration.cache-shell-fail.test.ts +++ b/tests/test-cases/cache-shell-fail/integration.cache-shell-fail.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/cache-shell/integration.cache-shell.test.ts b/tests/test-cases/cache-shell/integration.cache-shell.test.ts index eb0b886b5..2a8d36e3f 100644 --- a/tests/test-cases/cache-shell/integration.cache-shell.test.ts +++ b/tests/test-cases/cache-shell/integration.cache-shell.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cache-when/integration.cache-when.test.ts b/tests/test-cases/cache-when/integration.cache-when.test.ts index ea4c74760..7e710de5d 100644 --- a/tests/test-cases/cache-when/integration.cache-when.test.ts +++ b/tests/test-cases/cache-when/integration.cache-when.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/cli-option-variables/integration.cli-option-variables.test.ts b/tests/test-cases/cli-option-variables/integration.cli-option-variables.test.ts index cf8845e56..f141b25f1 100644 --- a/tests/test-cases/cli-option-variables/integration.cli-option-variables.test.ts +++ b/tests/test-cases/cli-option-variables/integration.cli-option-variables.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/concurrency/integration.concurrency.test.ts b/tests/test-cases/concurrency/integration.concurrency.test.ts index abee9a0f6..f1982958e 100644 --- a/tests/test-cases/concurrency/integration.concurrency.test.ts +++ b/tests/test-cases/concurrency/integration.concurrency.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/container-executable/container-executable.test.ts b/tests/test-cases/container-executable/container-executable.test.ts index eb9c28503..9b4a0f6ec 100644 --- a/tests/test-cases/container-executable/container-executable.test.ts +++ b/tests/test-cases/container-executable/container-executable.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/coverage/.gitlab-ci.yml b/tests/test-cases/coverage/.gitlab-ci.yml index b37f56890..66369552e 100644 --- a/tests/test-cases/coverage/.gitlab-ci.yml +++ b/tests/test-cases/coverage/.gitlab-ci.yml @@ -5,7 +5,7 @@ test-job: - "echo \" Lines: 48.46% (510/650)\"" - "echo \" Lines: 78.46% (510/650)\"" -jest: +import.meta.jest: coverage: /All files.*?\|.*?\|.*?([\d\.]+)/ script: - echo "All files | 99.3 | 97.91 | 100 | 100 | " diff --git a/tests/test-cases/coverage/integration.coverage.test.ts b/tests/test-cases/coverage/integration.coverage.test.ts index 459a8cfbe..2bfbcdc46 100644 --- a/tests/test-cases/coverage/integration.coverage.test.ts +++ b/tests/test-cases/coverage/integration.coverage.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); @@ -19,13 +19,13 @@ test("coverage ", async () => { expect(writeStreams.stdoutLines).toEqual(expect.arrayContaining(expected)); }); -test("coverage ", async () => { +test("coverage ", async () => { const writeStreams = new WriteStreamsMock(); await handler({ cwd: "tests/test-cases/coverage", - job: ["jest"], + job: ["import.meta.jest"], }, writeStreams); - const expected = [chalk`{black.bgGreenBright PASS } {blueBright jest} 97.91% {gray coverage}`]; + const expected = [chalk`{black.bgGreenBright PASS } {blueBright import.meta.jest} 97.91% {gray coverage}`]; expect(writeStreams.stdoutLines).toEqual(expect.arrayContaining(expected)); }); diff --git a/tests/test-cases/custom-home/integration.custom-home.test.ts b/tests/test-cases/custom-home/integration.custom-home.test.ts index 43dd0f1ce..2d7d4ab06 100644 --- a/tests/test-cases/custom-home/integration.custom-home.test.ts +++ b/tests/test-cases/custom-home/integration.custom-home.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { const spyGitRemote = { diff --git a/tests/test-cases/dependencies-not-found/integration.dependencies-not-found.test.ts b/tests/test-cases/dependencies-not-found/integration.dependencies-not-found.test.ts index a74e0d422..57efda591 100644 --- a/tests/test-cases/dependencies-not-found/integration.dependencies-not-found.test.ts +++ b/tests/test-cases/dependencies-not-found/integration.dependencies-not-found.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert, {AssertionError} from "assert"; beforeAll(() => { diff --git a/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts b/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts index 4eb63d7a5..7ea40092c 100644 --- a/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts +++ b/tests/test-cases/dind-no-tls/integration.dind-no-tls.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/dind-tls/integration.dind-tls.test.ts b/tests/test-cases/dind-tls/integration.dind-tls.test.ts index 25b5242ad..92e06204f 100644 --- a/tests/test-cases/dind-tls/integration.dind-tls.test.ts +++ b/tests/test-cases/dind-tls/integration.dind-tls.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/dotenv/integration.dotenv.test.ts b/tests/test-cases/dotenv/integration.dotenv.test.ts index 615fe7bd8..c86fa1121 100644 --- a/tests/test-cases/dotenv/integration.dotenv.test.ts +++ b/tests/test-cases/dotenv/integration.dotenv.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; beforeAll(() => { diff --git a/tests/test-cases/duplicated-keys/integration.environment.test.ts b/tests/test-cases/duplicated-keys/integration.environment.test.ts index e5d94df89..8e9f0c1f9 100644 --- a/tests/test-cases/duplicated-keys/integration.environment.test.ts +++ b/tests/test-cases/duplicated-keys/integration.environment.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/environment/integration.environment.test.ts b/tests/test-cases/environment/integration.environment.test.ts index 518a58446..268e8cb3c 100644 --- a/tests/test-cases/environment/integration.environment.test.ts +++ b/tests/test-cases/environment/integration.environment.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/extends/integration.extends.test.ts b/tests/test-cases/extends/integration.extends.test.ts index ba5f6094e..a2455d1d0 100644 --- a/tests/test-cases/extends/integration.extends.test.ts +++ b/tests/test-cases/extends/integration.extends.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/extra-host/integration.extra-host.test.ts b/tests/test-cases/extra-host/integration.extra-host.test.ts index 446a1b15f..b65b5f649 100644 --- a/tests/test-cases/extra-host/integration.extra-host.test.ts +++ b/tests/test-cases/extra-host/integration.extra-host.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; beforeAll(() => { diff --git a/tests/test-cases/gitlab-runner-emulation/integration.emulate-runner.test.ts b/tests/test-cases/gitlab-runner-emulation/integration.emulate-runner.test.ts index 0b92cf758..873b70d22 100644 --- a/tests/test-cases/gitlab-runner-emulation/integration.emulate-runner.test.ts +++ b/tests/test-cases/gitlab-runner-emulation/integration.emulate-runner.test.ts @@ -1,13 +1,13 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; -import {cleanupJobResources, Job} from "../../../src/job"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; +import {cleanupJobResources, Job} from "../../../src/job.js"; import { GitlabRunnerCPUsPresetValue, GitlabRunnerMemoryPresetValue, GitlabRunnerPresetValues, -} from "../../../src/gitlab-preset"; +} from "../../../src/gitlab-preset.js"; let jobs: Job[] = []; beforeAll(() => { diff --git a/tests/test-cases/hang-forever/integration.hang-forever.test.ts b/tests/test-cases/hang-forever/integration.hang-forever.test.ts index 11891e0e1..dbceeb31a 100644 --- a/tests/test-cases/hang-forever/integration.hang-forever.test.ts +++ b/tests/test-cases/hang-forever/integration.hang-forever.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/image/integration.image.test.ts b/tests/test-cases/image/integration.image.test.ts index 5c1ea842f..8c220e20a 100644 --- a/tests/test-cases/image/integration.image.test.ts +++ b/tests/test-cases/image/integration.image.test.ts @@ -1,12 +1,12 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; -import {cleanupJobResources, Job} from "../../../src/job"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; +import {cleanupJobResources, Job} from "../../../src/job.js"; -jest.setTimeout(30000); +import.meta.jest.setTimeout(30000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-component/integration.include-component.test.ts b/tests/test-cases/include-component/integration.include-component.test.ts index 3ce9281cb..d9099daab 100644 --- a/tests/test-cases/include-component/integration.include-component.test.ts +++ b/tests/test-cases/include-component/integration.include-component.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-inputs/integration.include-inputs.test.ts b/tests/test-cases/include-inputs/integration.include-inputs.test.ts index 69dd752a7..01810fb1f 100644 --- a/tests/test-cases/include-inputs/integration.include-inputs.test.ts +++ b/tests/test-cases/include-inputs/integration.include-inputs.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/include-invalid-local/integration.include-invalid-local.test.ts b/tests/test-cases/include-invalid-local/integration.include-invalid-local.test.ts index 10e715df6..972223739 100644 --- a/tests/test-cases/include-invalid-local/integration.include-invalid-local.test.ts +++ b/tests/test-cases/include-invalid-local/integration.include-invalid-local.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-invalid-project-file-ref/integration.include-invalid-project-ref-file.test.ts b/tests/test-cases/include-invalid-project-file-ref/integration.include-invalid-project-ref-file.test.ts index fdb21947c..4287ce3cf 100644 --- a/tests/test-cases/include-invalid-project-file-ref/integration.include-invalid-project-ref-file.test.ts +++ b/tests/test-cases/include-invalid-project-file-ref/integration.include-invalid-project-ref-file.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; test("include-invalid-project-file-ref", async () => { try { diff --git a/tests/test-cases/include-invalid-remote/integration.include-invalid-remote.test.ts b/tests/test-cases/include-invalid-remote/integration.include-invalid-remote.test.ts index 1e60b586f..c57c3b416 100644 --- a/tests/test-cases/include-invalid-remote/integration.include-invalid-remote.test.ts +++ b/tests/test-cases/include-invalid-remote/integration.include-invalid-remote.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import AxiosMockAdapter from "axios-mock-adapter"; import axios from "axios"; diff --git a/tests/test-cases/include-local-wildcard/integration.include-local.test.ts b/tests/test-cases/include-local-wildcard/integration.include-local.test.ts index ff71695e9..708d2ac02 100644 --- a/tests/test-cases/include-local-wildcard/integration.include-local.test.ts +++ b/tests/test-cases/include-local-wildcard/integration.include-local.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-local/integration.include-local.test.ts b/tests/test-cases/include-local/integration.include-local.test.ts index 518bfc6e2..4202bc119 100644 --- a/tests/test-cases/include-local/integration.include-local.test.ts +++ b/tests/test-cases/include-local/integration.include-local.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert, {AssertionError} from "assert"; beforeAll(() => { diff --git a/tests/test-cases/include-nested/integration.needs-empty.test.ts b/tests/test-cases/include-nested/integration.needs-empty.test.ts index 962d956e4..94c10b794 100644 --- a/tests/test-cases/include-nested/integration.needs-empty.test.ts +++ b/tests/test-cases/include-nested/integration.needs-empty.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; import assert, {AssertionError} from "assert"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; -import {ParserIncludes} from "../../../src/parser-includes"; +import {ParserIncludes} from "../../../src/parser-includes.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-project-file-ref-with-inner-local/integration.include-project-file-ref-with-inner-local.test.ts b/tests/test-cases/include-project-file-ref-with-inner-local/integration.include-project-file-ref-with-inner-local.test.ts index 4f1a2e6b3..ed3c5f1b8 100644 --- a/tests/test-cases/include-project-file-ref-with-inner-local/integration.include-project-file-ref-with-inner-local.test.ts +++ b/tests/test-cases/include-project-file-ref-with-inner-local/integration.include-project-file-ref-with-inner-local.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; test("include-project-file-ref-with-inner-local", async () => { diff --git a/tests/test-cases/include-project-file-ref/integration.include-project-file-ref.test.ts b/tests/test-cases/include-project-file-ref/integration.include-project-file-ref.test.ts index 5e081f16d..564b32902 100644 --- a/tests/test-cases/include-project-file-ref/integration.include-project-file-ref.test.ts +++ b/tests/test-cases/include-project-file-ref/integration.include-project-file-ref.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; test("include-project-file-ref ", async () => { diff --git a/tests/test-cases/include-remote/integration.include-remote.test.ts b/tests/test-cases/include-remote/integration.include-remote.test.ts index 81cb7e1a7..1b8ab9406 100644 --- a/tests/test-cases/include-remote/integration.include-remote.test.ts +++ b/tests/test-cases/include-remote/integration.include-remote.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import AxiosMockAdapter from "axios-mock-adapter"; import axios from "axios"; import fs from "fs-extra"; diff --git a/tests/test-cases/include-rules/integration.include-rules.test.ts b/tests/test-cases/include-rules/integration.include-rules.test.ts index 350efc41b..cac109742 100644 --- a/tests/test-cases/include-rules/integration.include-rules.test.ts +++ b/tests/test-cases/include-rules/integration.include-rules.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/include-template/integration.include-template.test.ts b/tests/test-cases/include-template/integration.include-template.test.ts index 38dc6ee10..46d5a5112 100644 --- a/tests/test-cases/include-template/integration.include-template.test.ts +++ b/tests/test-cases/include-template/integration.include-template.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/interactive-image/integration.interactive-image.test.ts b/tests/test-cases/interactive-image/integration.interactive-image.test.ts index 48d7bb872..a95f5ecd5 100644 --- a/tests/test-cases/interactive-image/integration.interactive-image.test.ts +++ b/tests/test-cases/interactive-image/integration.interactive-image.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/interactive/integration.interactive.test.ts b/tests/test-cases/interactive/integration.interactive.test.ts index fb0e26ac1..6ae133497 100644 --- a/tests/test-cases/interactive/integration.interactive.test.ts +++ b/tests/test-cases/interactive/integration.interactive.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/invalid-stages/integration.invalid-stages.test.ts b/tests/test-cases/invalid-stages/integration.invalid-stages.test.ts index af341a354..403c3d093 100644 --- a/tests/test-cases/invalid-stages/integration.invalid-stages.test.ts +++ b/tests/test-cases/invalid-stages/integration.invalid-stages.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/list-case/integration.list-case.test.ts b/tests/test-cases/list-case/integration.list-case.test.ts index edcf1da69..13b2b9138 100644 --- a/tests/test-cases/list-case/integration.list-case.test.ts +++ b/tests/test-cases/list-case/integration.list-case.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/list-csv-case/integration.list-case.test.ts b/tests/test-cases/list-csv-case/integration.list-case.test.ts index 5cd429ff7..6a03e976e 100644 --- a/tests/test-cases/list-csv-case/integration.list-case.test.ts +++ b/tests/test-cases/list-csv-case/integration.list-case.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/log-padding/integration.plain.log-padding.test.ts b/tests/test-cases/log-padding/integration.plain.log-padding.test.ts index d2ad7f0d4..c80535cd8 100644 --- a/tests/test-cases/log-padding/integration.plain.log-padding.test.ts +++ b/tests/test-cases/log-padding/integration.plain.log-padding.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/log-timestamps/integration.plain.log-timestamps.test.ts b/tests/test-cases/log-timestamps/integration.plain.log-timestamps.test.ts index f7d718704..dc4705a66 100644 --- a/tests/test-cases/log-timestamps/integration.plain.log-timestamps.test.ts +++ b/tests/test-cases/log-timestamps/integration.plain.log-timestamps.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert from "assert"; beforeAll(() => { diff --git a/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts b/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts index efd5e5d39..1fe4358e0 100644 --- a/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts +++ b/tests/test-cases/long-running-silent-build-job/long-running-silent-build-job.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; -jest.setTimeout(13000); +import.meta.jest.setTimeout(13000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts b/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts index 136295d7f..1d179bd8c 100644 --- a/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts +++ b/tests/test-cases/long-running-silent-test-job/long-running-silent-test-job.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; -jest.setTimeout(13000); +import.meta.jest.setTimeout(13000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/mac-address/integration.environment.test.ts b/tests/test-cases/mac-address/integration.environment.test.ts index 27560d8a5..d79916784 100644 --- a/tests/test-cases/mac-address/integration.environment.test.ts +++ b/tests/test-cases/mac-address/integration.environment.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/manual/integration.manual.test.ts b/tests/test-cases/manual/integration.manual.test.ts index 8739b5552..f65c1cb37 100644 --- a/tests/test-cases/manual/integration.manual.test.ts +++ b/tests/test-cases/manual/integration.manual.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-artifacts/integration.needs-artifacts.test.ts b/tests/test-cases/needs-artifacts/integration.needs-artifacts.test.ts index b1a81b47c..ad2da6222 100644 --- a/tests/test-cases/needs-artifacts/integration.needs-artifacts.test.ts +++ b/tests/test-cases/needs-artifacts/integration.needs-artifacts.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import fs from "fs-extra"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-contains-dependencies/integration.needs-contains-dependencies.test.ts b/tests/test-cases/needs-contains-dependencies/integration.needs-contains-dependencies.test.ts index bf71277b3..2f9b049c4 100644 --- a/tests/test-cases/needs-contains-dependencies/integration.needs-contains-dependencies.test.ts +++ b/tests/test-cases/needs-contains-dependencies/integration.needs-contains-dependencies.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-empty/integration.needs-empty.test.ts b/tests/test-cases/needs-empty/integration.needs-empty.test.ts index 1bde917b2..2201d28b8 100644 --- a/tests/test-cases/needs-empty/integration.needs-empty.test.ts +++ b/tests/test-cases/needs-empty/integration.needs-empty.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-invalid-stage/integration.needs-invalid-stage.test.ts b/tests/test-cases/needs-invalid-stage/integration.needs-invalid-stage.test.ts index d98049518..0d64b9994 100644 --- a/tests/test-cases/needs-invalid-stage/integration.needs-invalid-stage.test.ts +++ b/tests/test-cases/needs-invalid-stage/integration.needs-invalid-stage.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-optional-complex/integration.needs-optional-complex.test.ts b/tests/test-cases/needs-optional-complex/integration.needs-optional-complex.test.ts index 381da04a3..f9f5bbcf2 100644 --- a/tests/test-cases/needs-optional-complex/integration.needs-optional-complex.test.ts +++ b/tests/test-cases/needs-optional-complex/integration.needs-optional-complex.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-optional/integration.needs-optional.test.ts b/tests/test-cases/needs-optional/integration.needs-optional.test.ts index 29e25ffac..cd919eb5b 100644 --- a/tests/test-cases/needs-optional/integration.needs-optional.test.ts +++ b/tests/test-cases/needs-optional/integration.needs-optional.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-parallel/integration.needs-parallel.test.ts b/tests/test-cases/needs-parallel/integration.needs-parallel.test.ts index b6b0bd5d1..de8a0ff4b 100644 --- a/tests/test-cases/needs-parallel/integration.needs-parallel.test.ts +++ b/tests/test-cases/needs-parallel/integration.needs-parallel.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-pipeline/integration.needs-pipeline.test.ts b/tests/test-cases/needs-pipeline/integration.needs-pipeline.test.ts index 97f286800..2636ac804 100644 --- a/tests/test-cases/needs-pipeline/integration.needs-pipeline.test.ts +++ b/tests/test-cases/needs-pipeline/integration.needs-pipeline.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-same-stage/integration.needs-same-stage.test.ts b/tests/test-cases/needs-same-stage/integration.needs-same-stage.test.ts index de8d1249f..ae408937f 100644 --- a/tests/test-cases/needs-same-stage/integration.needs-same-stage.test.ts +++ b/tests/test-cases/needs-same-stage/integration.needs-same-stage.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-sequence/integration.needs-sequence.test.ts b/tests/test-cases/needs-sequence/integration.needs-sequence.test.ts index dc1f74375..de4c763f8 100644 --- a/tests/test-cases/needs-sequence/integration.needs-sequence.test.ts +++ b/tests/test-cases/needs-sequence/integration.needs-sequence.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/needs-unspecified-job/integration.needs-unspecified-job.test.ts b/tests/test-cases/needs-unspecified-job/integration.needs-unspecified-job.test.ts index 090b4ebd2..c91b8c650 100644 --- a/tests/test-cases/needs-unspecified-job/integration.needs-unspecified-job.test.ts +++ b/tests/test-cases/needs-unspecified-job/integration.needs-unspecified-job.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/network-alias-build/integration.network-alias-build.test.ts b/tests/test-cases/network-alias-build/integration.network-alias-build.test.ts index d5eb6c4a5..3fd435a0d 100644 --- a/tests/test-cases/network-alias-build/integration.network-alias-build.test.ts +++ b/tests/test-cases/network-alias-build/integration.network-alias-build.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/network-arg/integration.network-arg.test.ts b/tests/test-cases/network-arg/integration.network-arg.test.ts index ee63715a3..dcd602ffa 100644 --- a/tests/test-cases/network-arg/integration.network-arg.test.ts +++ b/tests/test-cases/network-arg/integration.network-arg.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {Job, cleanupJobResources} from "../../../src/job"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {Job, cleanupJobResources} from "../../../src/job.js"; import chalk from "chalk"; -import {initSpawnSpy, initBashSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy, initBashSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert from "assert"; import {AssertionError} from "assert"; diff --git a/tests/test-cases/never-needs/integration.never-needs.test.ts b/tests/test-cases/never-needs/integration.never-needs.test.ts index fcc846f77..1cc8bbc1e 100644 --- a/tests/test-cases/never-needs/integration.never-needs.test.ts +++ b/tests/test-cases/never-needs/integration.never-needs.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/never/integration.never.test.ts b/tests/test-cases/never/integration.never.test.ts index b21855275..3ae687c81 100644 --- a/tests/test-cases/never/integration.never.test.ts +++ b/tests/test-cases/never/integration.never.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/no-script/integration.no-script.test.ts b/tests/test-cases/no-script/integration.no-script.test.ts index 58f2733f6..6761bc4cf 100644 --- a/tests/test-cases/no-script/integration.no-script.test.ts +++ b/tests/test-cases/no-script/integration.no-script.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts b/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts index c8e918ca1..bed2a35d7 100644 --- a/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts +++ b/tests/test-cases/parallel-matrix/integration.parallel-matrix.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); test("parallel-matrix - ensure successful", async () => { const writeStreams = new WriteStreamsMock(); diff --git a/tests/test-cases/parallel/integration.parallel.test.ts b/tests/test-cases/parallel/integration.parallel.test.ts index 5c324cc22..228718763 100644 --- a/tests/test-cases/parallel/integration.parallel.test.ts +++ b/tests/test-cases/parallel/integration.parallel.test.ts @@ -1,5 +1,5 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; test("parallel ", async () => { diff --git a/tests/test-cases/plain/integration.plain.test.ts b/tests/test-cases/plain/integration.plain.test.ts index 630331879..4c35a59b8 100644 --- a/tests/test-cases/plain/integration.plain.test.ts +++ b/tests/test-cases/plain/integration.plain.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import fs from "fs-extra"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/predefined-variables/integration.predefined-variables.test.ts b/tests/test-cases/predefined-variables/integration.predefined-variables.test.ts index 9049def31..b31aeae1b 100644 --- a/tests/test-cases/predefined-variables/integration.predefined-variables.test.ts +++ b/tests/test-cases/predefined-variables/integration.predefined-variables.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; test("predefined-variables ", async () => { const writeStreams = new WriteStreamsMock(); diff --git a/tests/test-cases/preview/integration.preview.test.ts b/tests/test-cases/preview/integration.preview.test.ts index 77cc78989..e29e9ca76 100644 --- a/tests/test-cases/preview/integration.preview.test.ts +++ b/tests/test-cases/preview/integration.preview.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/project-variables-file/integration.project-variables-file.test.ts b/tests/test-cases/project-variables-file/integration.project-variables-file.test.ts index 1ee6f17c3..edef40b1e 100644 --- a/tests/test-cases/project-variables-file/integration.project-variables-file.test.ts +++ b/tests/test-cases/project-variables-file/integration.project-variables-file.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy([...WhenStatics.all]); diff --git a/tests/test-cases/pull-policy/integration.pull-policy.test.ts b/tests/test-cases/pull-policy/integration.pull-policy.test.ts index 4f17558d3..c197a72fc 100644 --- a/tests/test-cases/pull-policy/integration.pull-policy.test.ts +++ b/tests/test-cases/pull-policy/integration.pull-policy.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; -import {Utils} from "../../../src/utils"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; +import {Utils} from "../../../src/utils.js"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/reference-circular-chain/integration.reference-circular-chain.test.ts b/tests/test-cases/reference-circular-chain/integration.reference-circular-chain.test.ts index f0b1a042a..5f7cca40b 100644 --- a/tests/test-cases/reference-circular-chain/integration.reference-circular-chain.test.ts +++ b/tests/test-cases/reference-circular-chain/integration.reference-circular-chain.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/reference/integration.reference.test.ts b/tests/test-cases/reference/integration.reference.test.ts index 49f72c30a..d2a4143e3 100644 --- a/tests/test-cases/reference/integration.reference.test.ts +++ b/tests/test-cases/reference/integration.reference.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/remote-variables-file/integration.project-variables-file.test.ts b/tests/test-cases/remote-variables-file/integration.project-variables-file.test.ts index 7121038cf..1b232351c 100644 --- a/tests/test-cases/remote-variables-file/integration.project-variables-file.test.ts +++ b/tests/test-cases/remote-variables-file/integration.project-variables-file.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initBashSpy, initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { const spyGitArchive = { diff --git a/tests/test-cases/rules-changes/integration.rules-changes.test.ts b/tests/test-cases/rules-changes/integration.rules-changes.test.ts index 05afaa103..ae0d405f7 100644 --- a/tests/test-cases/rules-changes/integration.rules-changes.test.ts +++ b/tests/test-cases/rules-changes/integration.rules-changes.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy, initSyncSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy, initSyncSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/rules-exists/integration.rules-exists.test.ts b/tests/test-cases/rules-exists/integration.rules-exists.test.ts index 3cf21ec36..61dda5012 100644 --- a/tests/test-cases/rules-exists/integration.rules-exists.test.ts +++ b/tests/test-cases/rules-exists/integration.rules-exists.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/schema-validation/integration.schema-validation.test.ts b/tests/test-cases/schema-validation/integration.schema-validation.test.ts index 461f3b9de..86e58e37f 100644 --- a/tests/test-cases/schema-validation/integration.schema-validation.test.ts +++ b/tests/test-cases/schema-validation/integration.schema-validation.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import assert, {AssertionError} from "assert"; -import {stripAnsi} from "../../utils"; +import {stripAnsi} from "../../utils.js"; beforeAll(() => { diff --git a/tests/test-cases/script-blank/integration.script-blank.test.ts b/tests/test-cases/script-blank/integration.script-blank.test.ts index 8f4d37e38..bda9240d2 100644 --- a/tests/test-cases/script-blank/integration.script-blank.test.ts +++ b/tests/test-cases/script-blank/integration.script-blank.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; beforeAll(() => { diff --git a/tests/test-cases/script-failures/integration.script-failures.test.ts b/tests/test-cases/script-failures/integration.script-failures.test.ts index 17c9f51dd..cee9976b4 100644 --- a/tests/test-cases/script-failures/integration.script-failures.test.ts +++ b/tests/test-cases/script-failures/integration.script-failures.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/script-multidimension/integration.script-multidimension.test.ts b/tests/test-cases/script-multidimension/integration.script-multidimension.test.ts index b72e57233..5dcd71d11 100644 --- a/tests/test-cases/script-multidimension/integration.script-multidimension.test.ts +++ b/tests/test-cases/script-multidimension/integration.script-multidimension.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/scripts-as-string/integration.scripts-as-string.test.ts b/tests/test-cases/scripts-as-string/integration.scripts-as-string.test.ts index 041919a7f..b557e7b3f 100644 --- a/tests/test-cases/scripts-as-string/integration.scripts-as-string.test.ts +++ b/tests/test-cases/scripts-as-string/integration.scripts-as-string.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/services/integration.services.test.ts b/tests/test-cases/services/integration.services.test.ts index c4f55f613..0974cc034 100644 --- a/tests/test-cases/services/integration.services.test.ts +++ b/tests/test-cases/services/integration.services.test.ts @@ -1,11 +1,11 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import fs from "fs-extra"; -jest.setTimeout(30000); +import.meta.jest.setTimeout(30000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/stage-not-found/integration.stage-not-found.test.ts b/tests/test-cases/stage-not-found/integration.stage-not-found.test.ts index 617eea2c1..bb40ca568 100644 --- a/tests/test-cases/stage-not-found/integration.stage-not-found.test.ts +++ b/tests/test-cases/stage-not-found/integration.stage-not-found.test.ts @@ -1,9 +1,9 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; import assert, {AssertionError} from "assert"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/trigger/integration.trigger.test.ts b/tests/test-cases/trigger/integration.trigger.test.ts index 739f11ce0..d2731a121 100644 --- a/tests/test-cases/trigger/integration.trigger.test.ts +++ b/tests/test-cases/trigger/integration.trigger.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/umask/integration.umask.test.ts b/tests/test-cases/umask/integration.umask.test.ts index 9de82a404..463d47791 100644 --- a/tests/test-cases/umask/integration.umask.test.ts +++ b/tests/test-cases/umask/integration.umask.test.ts @@ -1,10 +1,10 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import chalk from "chalk"; -jest.setTimeout(60000); +import.meta.jest.setTimeout(60000); beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/variable-escaping/integration.variable-escaping.test.ts b/tests/test-cases/variable-escaping/integration.variable-escaping.test.ts index 234eb4e89..223bceadf 100644 --- a/tests/test-cases/variable-escaping/integration.variable-escaping.test.ts +++ b/tests/test-cases/variable-escaping/integration.variable-escaping.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/variable-expansion/integration.variable-expansion.test.ts b/tests/test-cases/variable-expansion/integration.variable-expansion.test.ts index a4a9ece6f..98a043b98 100644 --- a/tests/test-cases/variable-expansion/integration.variable-expansion.test.ts +++ b/tests/test-cases/variable-expansion/integration.variable-expansion.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/variable-order/integration.variable-order.test.ts b/tests/test-cases/variable-order/integration.variable-order.test.ts index b8cc8fe21..628a07029 100644 --- a/tests/test-cases/variable-order/integration.variable-order.test.ts +++ b/tests/test-cases/variable-order/integration.variable-order.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/variables-null/integration.variables-null.test.ts b/tests/test-cases/variables-null/integration.variables-null.test.ts index 462b6094f..e3f22b63c 100644 --- a/tests/test-cases/variables-null/integration.variables-null.test.ts +++ b/tests/test-cases/variables-null/integration.variables-null.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/when-always/integration.when-always.test.ts b/tests/test-cases/when-always/integration.when-always.test.ts index 5debd2f33..0fc1bd36e 100644 --- a/tests/test-cases/when-always/integration.when-always.test.ts +++ b/tests/test-cases/when-always/integration.when-always.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/when-on-failure/integration.on-failure.test.ts b/tests/test-cases/when-on-failure/integration.on-failure.test.ts index 46fbea992..7b9647882 100644 --- a/tests/test-cases/when-on-failure/integration.on-failure.test.ts +++ b/tests/test-cases/when-on-failure/integration.on-failure.test.ts @@ -1,8 +1,8 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; import chalk from "chalk"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; beforeAll(() => { initSpawnSpy(WhenStatics.all); diff --git a/tests/test-cases/when/integration.when.test.ts b/tests/test-cases/when/integration.when.test.ts index 571848fd0..d689155d1 100644 --- a/tests/test-cases/when/integration.when.test.ts +++ b/tests/test-cases/when/integration.when.test.ts @@ -1,7 +1,7 @@ -import {WriteStreamsMock} from "../../../src/write-streams"; -import {handler} from "../../../src/handler"; -import {initSpawnSpy} from "../../mocks/utils.mock"; -import {WhenStatics} from "../../mocks/when-statics"; +import {WriteStreamsMock} from "../../../src/write-streams.js"; +import {handler} from "../../../src/handler.js"; +import {initSpawnSpy} from "../../mocks/utils.mock.js"; +import {WhenStatics} from "../../mocks/when-statics.js"; import {AssertionError} from "assert"; import {assert} from "console"; diff --git a/tests/utils.test.ts b/tests/utils.test.ts index d38426fd8..4e94b3770 100644 --- a/tests/utils.test.ts +++ b/tests/utils.test.ts @@ -1,8 +1,8 @@ -import {GitData} from "../src/git-data"; -import {Utils} from "../src/utils"; -import {initSpawnSpyReject, initSpawnSpy} from "./mocks/utils.mock"; +import {GitData} from "../src/git-data.js"; +import {Utils} from "../src/utils.js"; +import {initSpawnSpyReject, initSpawnSpy} from "./mocks/utils.mock.js"; -import {isSshDirFound} from "./utils"; +import {isSshDirFound} from "./utils.js"; describe("remoteFileExist", () => { describe("protocol: git", () => { @@ -176,7 +176,7 @@ describe("evaluateRuleChanges", () => { ]; tests.forEach((t) => { test.concurrent(`${t.description} \t\t [input: ${t.input} pattern: ${t.pattern} hasChanges: ${t.hasChanges}]`, () => { - const spy = jest.spyOn(GitData, "changedFiles"); + const spy = import.meta.jest.spyOn(GitData, "changedFiles"); spy.mockReturnValue(t.input); expect(Utils.evaluateRuleChanges("origin/master", t.pattern)).toBe(t.hasChanges); }); diff --git a/tests/utils.ts b/tests/utils.ts index 2876db1e0..c9a3c1c6a 100644 --- a/tests/utils.ts +++ b/tests/utils.ts @@ -1,4 +1,4 @@ -import * as fs from "fs-extra"; +import fs from "fs-extra"; export function isSshDirFound () { try { diff --git a/tsconfig.json b/tsconfig.json index 50e8c0fe6..d27751840 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,14 @@ { "compilerOptions": { - "target": "ES2022", + "target": "esnext", + "module": "esnext", "moduleResolution": "node", - "module": "commonjs", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "inlineSourceMap": true, "inlineSources": true, "strict": true, - "skipLibCheck": true + "skipLibCheck": true, + "resolveJsonModule": true } }