mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
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:
@@ -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
|
||||
}
|
||||
@@ -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": "*",
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user