diff --git a/.github/workflows/lib-check.yml b/.github/workflows/lib-check.yml index 7290477b7..d53d94dd2 100644 --- a/.github/workflows/lib-check.yml +++ b/.github/workflows/lib-check.yml @@ -135,7 +135,7 @@ jobs: # Not using matrix because test later on cant needs a specific job bot-unit-test: name: Bot - needs: [build-dist, build-type-and-test] + needs: [build-dist] uses: ./.github/workflows/unit-test.yml secrets: inherit with: @@ -159,7 +159,7 @@ jobs: discordeno-unit-test: name: Discordeno - needs: [build-dist, build-type-and-test] + needs: [build-dist] uses: ./.github/workflows/unit-test.yml secrets: inherit with: @@ -174,7 +174,7 @@ jobs: gateway-unit-test: name: Gateway - needs: [build-dist, build-type-and-test] + needs: [build-dist] uses: ./.github/workflows/unit-test.yml secrets: inherit with: @@ -188,7 +188,7 @@ jobs: package: gateway gateway-other-runtime-test: name: Gateway - needs: [gateway-unit-test, gateway-integration-test] + needs: [gateway-unit-test] uses: ./.github/workflows/other-runtime-unit-test.yml secrets: inherit with: @@ -196,7 +196,7 @@ jobs: rest-unit-test: name: Rest - needs: [build-dist, build-type-and-test] + needs: [build-dist] uses: ./.github/workflows/unit-test.yml secrets: inherit with: @@ -220,7 +220,7 @@ jobs: types-unit-test: name: Types - needs: [build-dist, build-type-and-test] + needs: [build-dist] uses: ./.github/workflows/unit-test.yml secrets: inherit with: @@ -235,7 +235,7 @@ jobs: utils-unit-test: name: Utils - needs: [build-dist, build-type-and-test] + needs: [build-dist] uses: ./.github/workflows/unit-test.yml secrets: inherit with: diff --git a/.github/workflows/other-runtime-unit-test.yml b/.github/workflows/other-runtime-unit-test.yml index f8d5dd2ea..4f485ec24 100644 --- a/.github/workflows/other-runtime-unit-test.yml +++ b/.github/workflows/other-runtime-unit-test.yml @@ -16,9 +16,9 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 - - uses: denoland/setup-deno@main + - uses: denoland/setup-deno@v2 with: - deno-version: 'v1.29' + deno-version: 'v2.1.x' - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT @@ -41,21 +41,6 @@ jobs: with: path: .turbo key: ${{ runner.os }}-turbo-build-${{ github.sha }} - - name: Build type cache - if: steps.turbo-cache.outputs.cache-hit != 'true' - uses: actions/cache@v3 - with: - path: .turbo - key: ${{ runner.os }}-turbo-build:type-${{ github.sha }} - - name: Deno cache - uses: actions/cache@v4 - with: - path: | - ~/.deno - ~/.cache/deno - key: ${{ runner.os }}-deno-${{ inputs.package }}-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-deno-${{ inputs.package }} - name: Deno Unit Test run: yarn test:deno-unit --cache-dir=".turbo" --filter=./packages/${{ inputs.package }} bun-unit-test: @@ -68,7 +53,7 @@ jobs: node-version: 18 - uses: oven-sh/setup-bun@v2 with: - bun-version: '1.0.6' + bun-version: '1.1.42' - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT @@ -91,12 +76,6 @@ jobs: with: path: .turbo key: ${{ runner.os }}-turbo-build-${{ github.sha }} - - name: Build type cache - if: steps.turbo-cache.outputs.cache-hit != 'true' - uses: actions/cache@v3 - with: - path: .turbo - key: ${{ runner.os }}-turbo-build:type-${{ github.sha }} - name: Bun Unit Test run: yarn test:bun-unit --cache-dir=".turbo" --filter=./packages/${{ inputs.package }} timeout-minutes: 1 diff --git a/.mocharc.base.cjs b/.mocharc.base.cjs new file mode 100644 index 000000000..4d585c8b0 --- /dev/null +++ b/.mocharc.base.cjs @@ -0,0 +1,9 @@ +// This needs to be a different file as this is used for Deno and Bun + +module.exports = { + recursive: true, + timeout: 2000, + 'watch-extensions': 'ts', + 'watch-files': ['src', 'tests'], + parallel: false, +} diff --git a/.mocharc.cjs b/.mocharc.cjs new file mode 100644 index 000000000..cc65d8d85 --- /dev/null +++ b/.mocharc.cjs @@ -0,0 +1,6 @@ +module.exports = { + ...require('./.mocharc.base.cjs'), + require: 'ts-node/register', + loader: 'ts-node/esm', + 'enable-source-maps': true, +} diff --git a/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch b/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch new file mode 100644 index 000000000..ea888f425 --- /dev/null +++ b/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch @@ -0,0 +1,13 @@ +diff --git a/lib/cli/cli.js b/lib/cli/cli.js +index 5a4c6b8d53e8a01eca68b6d9d03b0f11626e77c1..2be60285c6c855417af39fb4b28b7f2928783312 100644 +--- a/lib/cli/cli.js ++++ b/lib/cli/cli.js +@@ -12,7 +12,7 @@ + + const debug = require('debug')('mocha:cli:cli'); + const symbols = require('log-symbols'); +-const yargs = require('yargs/yargs'); ++const yargs = require('yargs'); + const path = require('path'); + const { + loadRc, diff --git a/deno.json b/deno.json new file mode 100644 index 000000000..2ae8fedfb --- /dev/null +++ b/deno.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json", + "nodeModulesDir": "manual", + "lock": false, + "unstable": ["sloppy-imports"] +} diff --git a/denoImportMap.json b/denoImportMap.json deleted file mode 100644 index 4afeb3488..000000000 --- a/denoImportMap.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "imports": { - "node:buffer": "https://deno.land/std@0.176.0/node/buffer.ts", - "node:crypto": "https://deno.land/std@0.176.0/node/crypto.ts", - "node:fs": "https://deno.land/std@0.176.0/node/fs.ts", - "node:fs/promises": "https://deno.land/std@0.176.0/node/fs/promises.ts", - "node:events": "https://deno.land/std@0.176.0/node/events.ts", - "tweetnacl": "npm:tweetnacl", - "ws": "npm:ws", - "fzstd": "npm:fzstd", - "mocha": "https://deno.land/std@0.168.0/testing/bdd.ts", - "chai": "https://cdn.skypack.dev/chai@4.3.4?dts", - "sinon": "https://cdn.skypack.dev/sinon@15.0.0?dts", - "find-up": "npm:find-up", - "typescript": "npm:typescript", - "chai-as-promised": "npm:chai-as-promised", - "benchmark": "npm:benchmark", - "dotenv": "npm:dotenv", - "node:zlib": "https://deno.land/std@0.176.0/node/zlib.ts", - "node:assert": "https://deno.land/std@0.176.0/node/assert.ts", - "node:path": "https://deno.land/std@0.176.0/node/path.ts", - "node:url": "https://deno.land/std@0.176.0/node/url.ts", - "@discordeno/utils": "./packages/utils/dist/esm/index.js", - "@discordeno/types": "./packages/types/dist/esm/index.js", - "@discordeno/rest": "./packages/rest/dist/esm/index.js", - "@discordeno/gateway": "./packages/gateway/dist/esm/index.js", - "@discordeno/bot": "./packages/bot/dist/esm/index.js" - } -} diff --git a/packages/bot/.mocharc.json b/packages/bot/.mocharc.json deleted file mode 100644 index 4689d4a04..000000000 --- a/packages/bot/.mocharc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "require": "ts-node/register", - "loader": "ts-node/esm", - "recursive": true, - "timeout": 2000, - "watch-extensions": "ts", - "watch-files": ["src", "tests"], - "enable-source-maps": true, - "parallel": false -} diff --git a/packages/bot/package.json b/packages/bot/package.json index 92f0134e5..955dcd7ff 100644 --- a/packages/bot/package.json +++ b/packages/bot/package.json @@ -22,9 +22,10 @@ "lint": "biome lint --write", "test:unit-coverage": "c8 mocha --no-warnings 'tests/unit/**/*.spec.ts'", "test:unit": "c8 --r lcov mocha --no-warnings 'tests/unit/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js discordeno", - "test:deno-unit": "swc tests --strip-leading-paths --delete-dir-on-start --out-dir denoTestsDist && node ../../scripts/fixDenoTestExtension.js && deno test -A --import-map ../../denoImportMap.json denoTestsDist/unit", - "test:e2e": "c8 --r lcov mocha --no-warnings --jobs 1 --t 30000 'tests/e2e/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js rest", "test:unit:watch": "mocha --no-warnings --watch --parallel 'tests/unit/**/*.spec.ts'", + "test:deno-unit": "deno -A ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/unit/**/*.spec.ts'", + "test:bun-unit": "bun ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/unit/**/*.spec.ts'", + "test:e2e": "c8 --r lcov mocha --no-warnings --jobs 1 --t 30000 'tests/e2e/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js rest", "test:type": "tsc --noEmit", "test:test-type": "tsc --project tests/tsconfig.json" }, @@ -44,7 +45,7 @@ "@types/sinon": "^17.0.3", "c8": "^10.1.3", "chai": "^5.1.2", - "mocha": "^11.0.1", + "mocha": "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch", "sinon": "^19.0.2", "ts-node": "^10.9.2", "tsconfig": "*", diff --git a/packages/discordeno/.mocharc.json b/packages/discordeno/.mocharc.json deleted file mode 100644 index 4689d4a04..000000000 --- a/packages/discordeno/.mocharc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "require": "ts-node/register", - "loader": "ts-node/esm", - "recursive": true, - "timeout": 2000, - "watch-extensions": "ts", - "watch-files": ["src", "tests"], - "enable-source-maps": true, - "parallel": false -} diff --git a/packages/discordeno/package.json b/packages/discordeno/package.json index 382e8f344..f0bc47c3e 100644 --- a/packages/discordeno/package.json +++ b/packages/discordeno/package.json @@ -22,9 +22,9 @@ "lint": "biome lint --write", "test:unit-coverage": "c8 mocha --no-warnings 'tests/**/*.spec.ts'", "test:unit": "c8 --r lcov mocha --no-warnings 'tests/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js discordeno", - "test:deno-unit": "swc --strip-leading-paths tests --delete-dir-on-start --out-dir denoTestsDist && node ../../scripts/fixDenoTestExtension.js && deno test -A --import-map ../../denoImportMap.json denoTestsDist", - "test:bun-unit": "node ../../scripts/fixBunTestExtension.js && bun test bunTestsDist", "test:unit:watch": "mocha --no-warnings --watch --parallel 'tests/**/*.spec.ts'", + "test:deno-unit": "deno -A ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/**/*.spec.ts'", + "test:bun-unit": "bun ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/**/*.spec.ts'", "test:type": "tsc --noEmit", "test:test-type": "tsc --project tests/tsconfig.json" }, @@ -44,7 +44,7 @@ "@types/node": "^22.10.3", "c8": "^10.1.3", "chai": "^5.1.2", - "mocha": "^11.0.1", + "mocha": "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch", "ts-node": "^10.9.2", "tsconfig": "*", "typescript": "^5.7.2" diff --git a/packages/gateway/.mocharc.json b/packages/gateway/.mocharc.json deleted file mode 100644 index 4689d4a04..000000000 --- a/packages/gateway/.mocharc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "require": "ts-node/register", - "loader": "ts-node/esm", - "recursive": true, - "timeout": 2000, - "watch-extensions": "ts", - "watch-files": ["src", "tests"], - "enable-source-maps": true, - "parallel": false -} diff --git a/packages/gateway/package.json b/packages/gateway/package.json index 0ecbc2f36..848f224cb 100644 --- a/packages/gateway/package.json +++ b/packages/gateway/package.json @@ -22,8 +22,9 @@ "lint": "biome lint --write", "test:unit-coverage": "c8 mocha --no-warnings 'tests/unit/**/*.spec.ts'", "test:unit": "c8 --r lcov mocha --no-warnings 'tests/unit/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js gateway", - "test:deno-unit": "swc --strip-leading-paths tests --delete-dir-on-start --out-dir denoTestsDist && node ../../scripts/fixDenoTestExtension.js && deno test -A --import-map ../../denoImportMap.json denoTestsDist/unit", "test:unit:watch": "mocha --no-warnings --watch --parallel 'tests/unit/**/*.spec.ts'", + "test:deno-unit": "deno -A ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/unit/**/*.spec.ts'", + "test:bun-unit": "bun ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/unit/**/*.spec.ts'", "test:integration": "c8 --r lcov mocha --no-warnings 'tests/integration/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js gateway", "test:type": "tsc --noEmit", "test:test-type": "tsc --project tests/tsconfig.json" @@ -47,7 +48,7 @@ "@types/ws": "^8.5.13", "c8": "^10.1.3", "chai": "^5.1.2", - "mocha": "^11.0.1", + "mocha": "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch", "sinon": "^19.0.2", "ts-node": "^10.9.2", "tsconfig": "*", diff --git a/packages/rest/.mocharc.json b/packages/rest/.mocharc.json deleted file mode 100644 index 4689d4a04..000000000 --- a/packages/rest/.mocharc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "require": "ts-node/register", - "loader": "ts-node/esm", - "recursive": true, - "timeout": 2000, - "watch-extensions": "ts", - "watch-files": ["src", "tests"], - "enable-source-maps": true, - "parallel": false -} diff --git a/packages/rest/package.json b/packages/rest/package.json index 0e67f8172..8b53baf6b 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -22,10 +22,10 @@ "lint": "biome lint --write", "test:unit-coverage": "c8 mocha --no-warnings 'tests/unit/**/*.spec.ts'", "test:unit": "c8 --r lcov mocha --no-warnings 'tests/unit/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js rest", - "test:deno-unit": "swc tests --strip-leading-paths --delete-dir-on-start --out-dir denoTestsDist && node ../../scripts/fixDenoTestExtension.js && deno test -A --import-map ../../denoImportMap.json denoTestsDist/unit", - "test:bun-unit": "node ../../scripts/fixBunTestExtension.js && bun test bunTestsDist/unit", - "test:e2e": "c8 --r lcov mocha --exit --no-warnings --jobs 1 --t 30000 'tests/e2e/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js rest", "test:unit:watch": "mocha --no-warnings --watch --parallel 'tests/unit/**/*.spec.ts'", + "test:deno-unit": "deno -A ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/unit/**/*.spec.ts'", + "test:bun-unit": "bun ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/unit/**/*.spec.ts'", + "test:e2e": "c8 --r lcov mocha --exit --no-warnings --jobs 1 --t 30000 'tests/e2e/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js rest", "test:type": "tsc --noEmit", "test:test-type": "tsc --project tests/tsconfig.json" }, @@ -46,7 +46,7 @@ "chai": "^5.1.2", "chai-as-promised": "^8.0.1", "dotenv": "^16.4.7", - "mocha": "^11.0.1", + "mocha": "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch", "sinon": "^19.0.2", "ts-node": "^10.9.2", "tsconfig": "*", diff --git a/packages/types/.mocharc.json b/packages/types/.mocharc.json deleted file mode 100644 index 4689d4a04..000000000 --- a/packages/types/.mocharc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "require": "ts-node/register", - "loader": "ts-node/esm", - "recursive": true, - "timeout": 2000, - "watch-extensions": "ts", - "watch-files": ["src", "tests"], - "enable-source-maps": true, - "parallel": false -} diff --git a/packages/types/package.json b/packages/types/package.json index f9c6a61b5..1ed19bb3d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -22,8 +22,9 @@ "lint": "biome lint --write", "test:unit-coverage": "c8 mocha --no-warnings 'tests/**/*.spec.ts'", "test:unit": "c8 --r lcov mocha --no-warnings 'tests/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js utils", - "test:deno-unit": "swc tests --strip-leading-paths --delete-dir-on-start -C jsc.minify.mangle=false --out-dir denoTestsDist && node ../../scripts/fixDenoTestExtension.js && deno test -A --import-map ../../denoImportMap.json denoTestsDist", "test:unit:watch": "mocha --no-warnings --watch --parallel 'tests/**/*.spec.ts'", + "test:deno-unit": "deno -A ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/**/*.spec.ts'", + "test:bun-unit": "bun ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/**/*.spec.ts'", "test:type": "tsc --noEmit" }, "devDependencies": { @@ -33,7 +34,7 @@ "@types/mocha": "^10.0.10", "@types/node": "^22.10.3", "c8": "^10.1.3", - "mocha": "^11.0.1", + "mocha": "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch", "ts-node": "^10.9.2", "tsconfig": "*", "typescript": "^5.7.2" diff --git a/packages/utils/.mocharc.json b/packages/utils/.mocharc.json deleted file mode 100644 index 4689d4a04..000000000 --- a/packages/utils/.mocharc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "require": "ts-node/register", - "loader": "ts-node/esm", - "recursive": true, - "timeout": 2000, - "watch-extensions": "ts", - "watch-files": ["src", "tests"], - "enable-source-maps": true, - "parallel": false -} diff --git a/packages/utils/package.json b/packages/utils/package.json index 727e93b73..1a5acdf04 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -22,9 +22,9 @@ "lint": "biome lint --write", "test:unit-coverage": "c8 mocha --no-warnings 'tests/**/*.spec.ts'", "test:unit": "c8 --r lcov mocha --no-warnings 'tests/**/*.spec.ts' && node ../../scripts/coveragePathFixing.js utils", - "test:deno-unit": "swc tests --strip-leading-paths --delete-dir-on-start -C jsc.minify.mangle=false --out-dir denoTestsDist && node ../../scripts/fixDenoTestExtension.js && deno test -A --import-map ../../denoImportMap.json denoTestsDist", - "test:bun-unit": "node ../../scripts/fixBunTestExtension.js && bun test bunTestsDist", "test:unit:watch": "mocha --no-warnings --watch --parallel 'tests/**/*.spec.ts'", + "test:deno-unit": "deno -A ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/**/*.spec.ts'", + "test:bun-unit": "bun ../../node_modules/mocha/bin/mocha.js --config ../../.mocharc.base.cjs 'tests/**/*.spec.ts'", "test:type": "tsc --noEmit", "test:test-type": "tsc --project tests/tsconfig.json" }, @@ -41,7 +41,7 @@ "@types/sinon": "^17.0.3", "c8": "^10.1.3", "chai": "^5.1.2", - "mocha": "^11.0.1", + "mocha": "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch", "sinon": "^19.0.2", "ts-node": "^10.9.2", "tsconfig": "*", diff --git a/packages/utils/tests/bucket.spec.ts b/packages/utils/tests/bucket.spec.ts index d0cc58a1d..fb4b72709 100644 --- a/packages/utils/tests/bucket.spec.ts +++ b/packages/utils/tests/bucket.spec.ts @@ -15,14 +15,12 @@ describe('bucket.ts', () => { let clock: sinon.SinonFakeTimers beforeEach(() => { - console.log('before') clock = sinon.useFakeTimers() }) afterEach(() => { sinon.restore() clock.restore() - console.log('after') }) describe('LeakyBucket function', () => { diff --git a/packages/utils/tests/urlToBase64.spec.ts b/packages/utils/tests/urlToBase64.spec.ts index 26924bed9..d48c0760b 100644 --- a/packages/utils/tests/urlToBase64.spec.ts +++ b/packages/utils/tests/urlToBase64.spec.ts @@ -7,7 +7,7 @@ describe('urlToBase64.ts', () => { let fetchStub: sinon.SinonStub beforeEach(() => { - fetchStub = sinon.stub(typeof global !== 'undefined' ? global : window, 'fetch') + fetchStub = sinon.stub(globalThis, 'fetch') }) afterEach(() => { diff --git a/scripts/fixBunTestExtension.js b/scripts/fixBunTestExtension.js deleted file mode 100644 index b0373e6a9..000000000 --- a/scripts/fixBunTestExtension.js +++ /dev/null @@ -1,21 +0,0 @@ -import fs from 'node:fs' - -const dirs = [''] -try { - fs.rmSync('bunTestsDist', { recursive: true, force: true }) -} catch { - // -} -for await (const dir of dirs) { - await Promise.all( - fs.readdirSync(`tests${dir}`).map(async (file) => { - if (!file.endsWith('.ts') && !file.includes('.')) { - dirs.push(`${dir}/${file}`) - return - } - const content = await fs.promises.readFile(`tests${dir}/${file}`, 'utf-8') - fs.mkdirSync(`bunTestsDist${dir}`, { recursive: true }) - fs.promises.writeFile(`bunTestsDist${dir}/${file}`, content.replace(/'mocha'/g, "'bun:test'")) - }), - ) -} diff --git a/scripts/fixDenoTestExtension.js b/scripts/fixDenoTestExtension.js deleted file mode 100644 index 98d1aeef1..000000000 --- a/scripts/fixDenoTestExtension.js +++ /dev/null @@ -1,22 +0,0 @@ -import fs from 'node:fs' - -const dirs = [''] -for await (const dir of dirs) { - await Promise.all( - fs.readdirSync(`denoTestsDist${dir}`).map(async (file) => { - if (!file.endsWith('.js') && !file.endsWith('.map') && !file.endsWith('.ts')) { - dirs.push(`${dir}/${file}`) - return - } - const content = await fs.promises.readFile(`denoTestsDist${dir}/${file}`, 'utf-8') - await fs.promises.rm(`denoTestsDist${dir}/${file}`) - fs.promises.writeFile( - `denoTestsDist${dir}/${file.slice(-8) === '.spec.js' ? `${file.slice(0, -7)}test.js` : file}`, - content - .replace(/src\//g, 'dist/esm/') - .replace(/describe\.skip/g, 'describe.ignore') - .replace(/it\.skip/g, 'it.ignore'), - ) - }), - ) -} diff --git a/turbo.json b/turbo.json index 6a33ebf0f..2f02bfc3e 100644 --- a/turbo.json +++ b/turbo.json @@ -14,7 +14,7 @@ "outputs": ["coverage/**"] }, "test:unit": { - "dependsOn": ["^build", "build", "build:type"], + "dependsOn": ["^build", "build"], "outputs": ["coverage/**"] }, "test:integration": { @@ -25,12 +25,10 @@ "dependsOn": ["^build:type"] }, "test:deno-unit": { - "dependsOn": ["^build", "build", "build:type"], - "outputs": ["denoTestsDist/**"] + "dependsOn": ["^build", "build"] }, "test:bun-unit": { - "dependsOn": ["^build", "build", "build:type"], - "outputs": ["bunTestsDist/**"] + "dependsOn": ["^build", "build"] }, "test:e2e": { "dependsOn": ["^build"], diff --git a/yarn.lock b/yarn.lock index 962e282af..ac51b40e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -129,7 +129,7 @@ __metadata: "@types/sinon": "npm:^17.0.3" c8: "npm:^10.1.3" chai: "npm:^5.1.2" - mocha: "npm:^11.0.1" + mocha: "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch" sinon: "npm:^19.0.2" ts-node: "npm:^10.9.2" tsconfig: "npm:*" @@ -154,7 +154,7 @@ __metadata: c8: "npm:^10.1.3" chai: "npm:^5.1.2" fzstd: "npm:^0.1.1" - mocha: "npm:^11.0.1" + mocha: "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch" sinon: "npm:^19.0.2" ts-node: "npm:^10.9.2" tsconfig: "npm:*" @@ -185,7 +185,7 @@ __metadata: chai: "npm:^5.1.2" chai-as-promised: "npm:^8.0.1" dotenv: "npm:^16.4.7" - mocha: "npm:^11.0.1" + mocha: "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch" sinon: "npm:^19.0.2" ts-node: "npm:^10.9.2" tsconfig: "npm:*" @@ -203,7 +203,7 @@ __metadata: "@types/mocha": "npm:^10.0.10" "@types/node": "npm:^22.10.3" c8: "npm:^10.1.3" - mocha: "npm:^11.0.1" + mocha: "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch" ts-node: "npm:^10.9.2" tsconfig: "npm:*" typescript: "npm:^5.7.2" @@ -224,7 +224,7 @@ __metadata: "@types/sinon": "npm:^17.0.3" c8: "npm:^10.1.3" chai: "npm:^5.1.2" - mocha: "npm:^11.0.1" + mocha: "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch" sinon: "npm:^19.0.2" ts-node: "npm:^10.9.2" tsconfig: "npm:*" @@ -1878,7 +1878,7 @@ __metadata: "@types/node": "npm:^22.10.3" c8: "npm:^10.1.3" chai: "npm:^5.1.2" - mocha: "npm:^11.0.1" + mocha: "patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch" ts-node: "npm:^10.9.2" tsconfig: "npm:*" typescript: "npm:^5.7.2" @@ -3163,7 +3163,7 @@ __metadata: languageName: node linkType: hard -"mocha@npm:^11.0.1": +"mocha@npm:11.0.2": version: 11.0.2 resolution: "mocha@npm:11.0.2" dependencies: @@ -3194,6 +3194,37 @@ __metadata: languageName: node linkType: hard +"mocha@patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch": + version: 11.0.2 + resolution: "mocha@patch:mocha@npm%3A11.0.2#~/.yarn/patches/mocha-npm-11.0.2-b5d6b95284.patch::version=11.0.2&hash=15fdee" + dependencies: + ansi-colors: "npm:^4.1.3" + browser-stdout: "npm:^1.3.1" + chokidar: "npm:^3.5.3" + debug: "npm:^4.3.5" + diff: "npm:^5.2.0" + escape-string-regexp: "npm:^4.0.0" + find-up: "npm:^5.0.0" + glob: "npm:^10.4.5" + he: "npm:^1.2.0" + js-yaml: "npm:^4.1.0" + log-symbols: "npm:^4.1.0" + minimatch: "npm:^5.1.6" + ms: "npm:^2.1.3" + serialize-javascript: "npm:^6.0.2" + strip-json-comments: "npm:^3.1.1" + supports-color: "npm:^8.1.1" + workerpool: "npm:^6.5.1" + yargs: "npm:^16.2.0" + yargs-parser: "npm:^20.2.9" + yargs-unparser: "npm:^2.0.0" + bin: + _mocha: bin/_mocha + mocha: bin/mocha.js + checksum: 02b3a6136d6223dd90204de2ef0e724b3e0672b788328a9313d1e45a7b07a78d4c1a03ef04e560ac37703db1eaa7b1d9c5ee2e9ad9ca52c3d8dc49507b6e208e + languageName: node + linkType: hard + "ms@npm:2.1.2": version: 2.1.2 resolution: "ms@npm:2.1.2"