Skip to content

Commit

Permalink
test: use Vitest instead of Jest (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
pure-js authored Aug 14, 2023
1 parent a4e5d8b commit ef7fdc3
Show file tree
Hide file tree
Showing 8 changed files with 9,701 additions and 8,949 deletions.
18,631 changes: 9,689 additions & 8,942 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
"description": "Browser detection using the user agent, returns the name and version of the browser",
"main": "dist/browser-detection.js",
"scripts": {
"prepare": "npm start",
"start": "webpack --config webpack.config.js",
"lint": "eslint src/**/*.js",
"test": "jest --coverage"
"lint": "eslint src/**/*.ts",
"test": "vitest --coverage"
},
"nyc": {
"exclude": [
Expand All @@ -34,13 +33,13 @@
"@babel/core": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/register": "^7.0.0",
"@vitest/coverage-v8": "^0.34.1",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"babel-minify-webpack-plugin": "^0.3.1",
"clean-webpack-plugin": "^0.1.19",
"eslint": "^5.12.0",
"eslint-config-google": "^0.11.0",
"jest": "^23.6.0",
"vitest": "^0.34.1",
"webpack": "^4.19.1",
"webpack-cli": "^3.1.0"
},
Expand Down
2 changes: 2 additions & 0 deletions src/browser-detection.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, expect, test } from 'vitest';

import {
detectBrowserName,
detectBrowserVersion,
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions src/is-deprecated.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { expect, test } from 'vitest';

import {browserIsDeprecated} from './is-deprecated';

test('Should be able to detect deprecated browser from object', () => {
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions src/rendering-engine-detection.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { describe, expect, test } from 'vitest';

import {
detectRenderingEngineNameAndVersion,
} from './rendering-engine-detection';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function detectRenderingEngineVersion(userAgent) {
*/
function detectRenderingEngineNameAndVersion(userAgent) {
return {
name: detectRenderingEngineName(),
version: detectRenderingEngineVersion(),
name: detectRenderingEngineName(userAgent),
version: detectRenderingEngineVersion(userAgent),
};
}

Expand Down

0 comments on commit ef7fdc3

Please sign in to comment.