From 23b74ee6661b0c7db17ec4f15d8c33a51df60187 Mon Sep 17 00:00:00 2001 From: Tsvetomir Tsonev Date: Mon, 23 Dec 2024 14:18:26 +0200 Subject: [PATCH] chore: replace mocha with vitest --- .mocharc.js | 6 ---- package.json | 7 ++--- test/browser/test.html | 56 ------------------------------------ test/browser/test.js | 42 --------------------------- test/chunks.js | 10 ++----- test/deflate.js | 9 ++---- test/deflate_cover.js | 12 +++----- test/gzip_specials.js | 7 ++--- test/helpers.js | 8 ++---- test/inflate.js | 9 ++---- test/inflate_cover_ported.js | 12 +++----- test/misc.js | 7 ++--- test/strings.js | 10 ++----- vitest.config.mjs | 8 ++++++ 14 files changed, 37 insertions(+), 166 deletions(-) delete mode 100644 .mocharc.js delete mode 100644 test/browser/test.html delete mode 100644 test/browser/test.js create mode 100644 vitest.config.mjs diff --git a/.mocharc.js b/.mocharc.js deleted file mode 100644 index c40cf61..0000000 --- a/.mocharc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - reporter: 'spec', - timeout: 60000, - require: 'reify', - 'watch-files': ['lib/**/*.js', 'test/**/*.js'] -}; diff --git a/package.json b/package.json index aabd6ce..fc51933 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "sideEffects": false, "scripts": { "build-package": "rollup -c", - "test": "mocha", + "test": "vitest --run", "lint": "eslint", "prepare": "husky" }, @@ -30,7 +30,6 @@ "Jean-loup Gailly", "Mark Adler" ], - "dependencies": {}, "devDependencies": { "@commitlint/cli": "^19.6.1", "@commitlint/config-conventional": "^19.6.0", @@ -39,11 +38,9 @@ "eslint": "^9.17.0", "globals": "^15.14.0", "husky": "^9.1.7", - "mocha": "^7.1.1", - "reify": "^0.20.12", "rollup": "^4.29.1", "semantic-release": "^24.2.0", - "zlibjs": "^0.3.1" + "vitest": "^2.1.8" }, "repository": { "type": "git", diff --git a/test/browser/test.html b/test/browser/test.html deleted file mode 100644 index cb36bab..0000000 --- a/test/browser/test.html +++ /dev/null @@ -1,56 +0,0 @@ - - - pako tests - - - - - - - - - - - - -
- - - diff --git a/test/browser/test.js b/test/browser/test.js deleted file mode 100644 index c224470..0000000 --- a/test/browser/test.js +++ /dev/null @@ -1,42 +0,0 @@ -/*global describe, it, pako, assert*/ - - -'use strict'; - - -var size = 100*1000; - -var data_bin = (typeof Uint8Array !== 'undefined') ? new Uint8Array(size) : new Array(size); - -for (var i=data_bin.length-1; i>=0; i--) { data_bin[i] = (Math.random(256)*256) & 0xff; } - -var cmp = function (a, b) { - if (a.length !== b.length) { return false; } - for (var i=0, l=a.length; i 0xffff values function fixedFromCharCode(code) { diff --git a/vitest.config.mjs b/vitest.config.mjs new file mode 100644 index 0000000..65f64e8 --- /dev/null +++ b/vitest.config.mjs @@ -0,0 +1,8 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + include: ['test/**/*.js'], + exclude: ['test/helpers.js'] + }, +})