Skip to content

Commit

Permalink
change from jest to vitest
Browse files Browse the repository at this point in the history
this change is to follow what homebridge repo is using
  • Loading branch information
donavanbecker committed Nov 3, 2024
1 parent 29a1e48 commit 53178c1
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 214 deletions.
178 changes: 0 additions & 178 deletions .eslintrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules
.idea
.DS_Store
.env
coverage
dist
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ node_modules
.prettierrc
jest.config.js
tsconfig.json
coverage
27 changes: 27 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import antfu from '@antfu/eslint-config'

export default antfu({
ignores: ['dist', 'docs'],
rules: {
'new-cap': 'off',
'import/extensions': ['error', 'ignorePackages'],
'import/order': 'off',
'jsdoc/check-alignment': 'error',
'jsdoc/check-line-alignment': 'error',
'no-undef': 'error',
'perfectionist/sort-exports': 'error',
'perfectionist/sort-named-exports': 'error',
'perfectionist/sort-named-imports': 'error',
'quotes': ['error', 'single'],
'sort-imports': 'off',
'style/brace-style': ['error', '1tbs'],
'style/quote-props': ['error', 'consistent-as-needed'],
'test/no-only-tests': 'error',
'unicorn/no-useless-spread': 'error',
'unused-imports/no-unused-vars': ['error', { caughtErrors: 'none' }],
},
typescript: true,
formatters: {
markdown: true,
},
})
7 changes: 0 additions & 7 deletions jest.config.js

This file was deleted.

1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 20 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"name": "@homebridge/camera-utils",
"version": "3.0.0",
"type": "module",
"version": "2.3.0",
"description": "Utilities to simplify homebridge camera plugin development",
"author": "dgreif",
"maintainers": [
{
"name": "dgreif"
}
],
"license": "MIT",
"homepage": "https://github.com/homebridge/camera-utils#readme",
"repository": {
Expand All @@ -21,19 +27,17 @@
"rtp",
"ffmpeg"
],
"main": "dist/index.js",
"main": "lib/index.js",
"scripts": {
"check": "npm install && npm outdated",
"test": "vitest",
"test-coverage": "vitest run --coverage",
"watch:link": "npm link && tsc --watch --declaration",
"lint": "eslint '**/*.ts' --fix",
"build": "npm run clean && tsc --declaration",
"build": "npm run clean && rm -rf lib && tsc --declaration",
"prepublishOnly": "npm i --package-lock-only && npm run lint && npm run build",
"postpublish": "npm run clean",
"clean": "rimraf dist && rimraf coverage",
"docs": "typedoc",
"lint-docs": "typedoc --emit none --treatWarningsAsErrors"
"clean": "rimraf dist && rimraf coverage"
},
"standard-version": {
"scripts": {
Expand All @@ -43,37 +47,30 @@
"publishConfig": {
"access": "public"
},
"maintainers": [
"dgreif"
],
"dependencies": {
"execa": "^9.5.1",
"ffmpeg-for-homebridge": "^2.1.7",
"execa": "^9.4.0",
"ffmpeg-for-homebridge": "^2.1.2",
"pick-port": "^2.1.0",
"rxjs": "^7.8.1",
"systeminformation": "^5.23.5"
},
"files": [
"dist"
],
"devDependencies": {
"@antfu/eslint-config": "^3.8.0",
"@antfu/eslint-config": "^3.7.3",
"@types/debug": "^4.1.12",
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.8.7",
"@types/node": "^22.7.4",
"@types/semver": "^7.5.8",
"@types/source-map-support": "^0.5.10",
"@vitest/coverage-v8": "^2.1.4",
"@vitest/coverage-v8": "^2.1.2",
"dotenv": "^16.4.5",
"eslint": "^9.14.0",
"eslint": "^9.10.0",
"eslint-plugin-format": "^0.1.2",
"nodemon": "^3.1.7",
"rimraf": "^6.0.1",
"standard-version": "^9.5.0",
"ts-node": "^10.9.2",
"typedoc": "^0.26.11",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vitest": "^2.1.4"
"typescript": "^5.6.2",
"vite": "^5.4.8",
"vitest": "^2.1.2"
}
}
}
5 changes: 0 additions & 5 deletions test/.eslintrc.json

This file was deleted.

3 changes: 3 additions & 0 deletions test/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const env = {
jest: true,
};
12 changes: 12 additions & 0 deletions vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// vite.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
coverage: {
include: ['src/**'],
},
pool: 'threads',
testTimeout: 10000,
},
})

0 comments on commit 53178c1

Please sign in to comment.