ci: Use mocha for both deno and bun (#4067)

* Use mocha for both deno and bun

* Use any Bun 1.1

* remove build:type dependency in lib-check.yml

* Pin point 1.1.42

* remove packages/bot/.mocharc.json
This commit is contained in:
Fleny
2025-01-01 09:59:06 -08:00
committed by GitHub
parent f2f7f111fb
commit b0c1b9f795
25 changed files with 106 additions and 195 deletions
-10
View File
@@ -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
}
+3 -3
View File
@@ -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": "*",
-2
View File
@@ -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', () => {
+1 -1
View File
@@ -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(() => {