Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vitest #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 0 additions & 203 deletions jest.config.ts

This file was deleted.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"tsc": "tsc",
"demo": "tsx demo",
"lint": "eslint ./src/**/**/* --fix",
"test": "jest",
"test": "vitest",
"test:outdir": "yarn outdir:prepare && OUT_DIR='public' yarn test && yarn outdir:revert",
"outdir:prepare": "mv build public",
"outdir:revert": "mv public build",
"test:coverage": "jest --collect-coverage",
"test:coverage": "vitest run --coverage",
"postinstall": "cp -r ./src/build/ ./build",
"postversion": "git push && git push --follow-tags",
"publish:next": "yarn && yarn build && yarn test && cd dist && npm publish --tag next",
Expand All @@ -38,11 +38,11 @@
"devDependencies": {
"@babel/preset-typescript": "^7.24.7",
"@types/glob": "^8.1.0",
"@types/jest": "^29.5.12",
"@types/minimist": "^1.2.5",
"@types/node": "22.4.1",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"@vitest/coverage-c8": "^0.30.1",
"eslint": "^9.9.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -54,9 +54,9 @@
"pretty-quick": "^4.0.0",
"rimraf": "^5.0.9",
"ts-jest": "^29.2.4",
"ts-node": "^10.9.2",
"tsx": "^4.17.0",
"typescript": "^5.5.4"
"typescript": "^5.5.4",
"vitest": "^0.30.1"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 2 additions & 1 deletion tests/files.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { existsSync, mkdirSync, readFileSync, rmdirSync } from 'fs';
import { describe, expect, test } from 'vitest';
import { version } from '../package.json';
import { writeSitemap } from '../src/helpers/global.helper';
import { CHUNK } from '../src/vars';
import { deleteFolderIfExist, TEST_FOLDER } from './utils-test';
import { TEST_FOLDER, deleteFolderIfExist } from './utils-test';

describe('Creating files', () => {
const json = [
Expand Down
1 change: 1 addition & 0 deletions tests/helper.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, test } from 'vitest';
import { removeHtml } from '../src/helpers/global.helper';

describe('Remove html', () => {
Expand Down
1 change: 1 addition & 0 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, test } from 'vitest';
import { prepareData } from '../src/helpers/global.helper';
import { optionsTest, sortbyPage } from './utils-test';

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "es2017",
"lib": ["dom"],
"types": ["node", "jest"],
"types": ["node"],
"baseUrl": "./src",
"esModuleInterop": true,
"module": "commonjs",
Expand Down
9 changes: 9 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
coverage: {
provider: 'c8'
}
}
});
Loading