Skip to content

Commit

Permalink
jest => vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzogg committed Jun 19, 2024
1 parent 614126c commit 217a6dd
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 51 deletions.
10 changes: 9 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
module.exports = require('@chubbyts/chubbyts-eslint/dist/eslintrc').default;
const eslintrc = require('@chubbyts/chubbyts-eslint/dist/eslintrc').default;

module.exports = {
...eslintrc,
rules: {
...eslintrc.rules,
'functional/prefer-tacit': 'off'
}
};
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
node-version: '16'
- run: npm install
- run: npm test
- run: npm test -- --run --no-cache
node18:
name: Node 18
runs-on: ubuntu-22.04
Expand All @@ -32,7 +32,7 @@ jobs:
with:
node-version: '18'
- run: npm install
- run: npm test
- run: npm test -- --run --no-cache
node20:
name: Node 20
runs-on: ubuntu-22.04
Expand All @@ -46,7 +46,7 @@ jobs:
- run: npm install
- run: npm run lint
- run: npm run cs
- run: npm test -- --coverage --no-cache
- run: npm test -- --run --coverage --no-cache
- run: npm run infection
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ A simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.

* node: 16
* [@chubbyts/chubbyts-throwable-to-error][2]: ^1.2.1
* [fast-xml-parser][3]: ^4.3.1
* [qs][4]: ^6.11.2
* [yaml][5]: ^2.3.2
* [fast-xml-parser][3]: ^4.4.0
* [qs][4]: ^6.12.1
* [yaml][5]: ^2.4.5

## Installation

Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-decode-encode][1].

```ts
npm i @chubbyts/chubbyts-decode-encode@^1.3.3
npm i @chubbyts/chubbyts-decode-encode@^1.3.4
```

## Usage
Expand Down
15 changes: 0 additions & 15 deletions jest.config.cjs

This file was deleted.

32 changes: 15 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@chubbyts/chubbyts-decode-encode",
"type": "module",
"version": "1.3.3",
"version": "1.3.4",
"description": "A simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.",
"keywords": [
"chubbyts",
Expand All @@ -24,7 +24,7 @@
"lint-fix": "eslint src tests --fix",
"lint": "eslint src tests",
"prepare": "npm run build",
"test": "jest"
"test": "vitest"
},
"prettier": {
"printWidth": 120,
Expand Down Expand Up @@ -66,24 +66,22 @@
},
"dependencies": {
"@chubbyts/chubbyts-throwable-to-error": "^1.2.1",
"fast-xml-parser": "^4.3.1",
"qs": "^6.11.2",
"yaml": "^2.3.2"
"fast-xml-parser": "^4.4.0",
"qs": "^6.12.1",
"yaml": "^2.4.5"
},
"devDependencies": {
"@chubbyts/chubbyts-eslint": "^2.0.3",
"@chubbyts/chubbyts-function-mock": "^1.4.1",
"@chubbyts/chubbyts-packaging": "^2.0.6",
"@chubbyts/chubbyts-eslint": "^2.0.4",
"@chubbyts/chubbyts-function-mock": "^1.4.3",
"@chubbyts/chubbyts-packaging": "^2.0.7",
"@stryker-mutator/core": "^8.2.6",
"@stryker-mutator/jest-runner": "^8.2.6",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.30",
"@types/qs": "^6.9.14",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"prettier-2": "npm:prettier@^2.8.8",
"ts-jest": "^29.1.2",
"typescript": "^5.4.3"
"@stryker-mutator/vitest-runner": "^8.2.6",
"@types/node": "^20.14.6",
"@types/qs": "^6.9.15",
"@vitest/coverage-v8": "^1.6.0",
"prettier": "^3.3.2",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 4 additions & 1 deletion stryker.conf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
"testRunner": "jest",
"testRunner": "vitest",
"vitest": {
"configFile": "vitest.config.ts"
},
"coverageAnalysis": "off",
"reporters": [
"clear-text",
Expand Down
2 changes: 1 addition & 1 deletion tests/decoder/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import { useObjectMock } from '@chubbyts/chubbyts-function-mock/dist/object-mock';
import type { TypeDecoder } from '../../src/decoder';
import { createDecoder } from '../../src/decoder';
Expand Down
2 changes: 1 addition & 1 deletion tests/decoder/json-type-decoder.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import { DecodeError } from '../../src/decoder';
import { createJsonTypeDecoder } from '../../src/decoder/json-type-decoder';
import data from '../data';
Expand Down
2 changes: 1 addition & 1 deletion tests/decoder/jsonx-type-decoder.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import { DecodeError } from '../../src/decoder';
import { createJsonxTypeDecoder } from '../../src/decoder/jsonx-type-decoder';
import data from '../data';
Expand Down
2 changes: 1 addition & 1 deletion tests/decoder/url-encoded-type-decoder.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import { createUrlEncodedTypeDecoder } from '../../src/decoder/url-encoded-type-decoder';
import data from '../data';

Expand Down
2 changes: 1 addition & 1 deletion tests/decoder/yaml-type-decoder.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import { DecodeError } from '../../src/decoder';
import { createYamlTypeDecoder } from '../../src/decoder/yaml-type-decoder';
import data from '../data';
Expand Down
2 changes: 1 addition & 1 deletion tests/encoder/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import { useObjectMock } from '@chubbyts/chubbyts-function-mock/dist/object-mock';
import type { TypeEncoder } from '../../src/encoder';
import { createEncoder } from '../../src/encoder';
Expand Down
2 changes: 1 addition & 1 deletion tests/encoder/json-type-encoder.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import { createJsonTypeEncoder } from '../../src/encoder/json-type-encoder';
import data from '../data';

Expand Down
2 changes: 1 addition & 1 deletion tests/encoder/jsonx-type-encoder.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import type { Data } from '../../src';
import { EncodeError } from '../../src/encoder';
import { createJsonxTypeEncoder } from '../../src/encoder/jsonx-type-encoder';
Expand Down
2 changes: 1 addition & 1 deletion tests/encoder/url-encoded-type-encoder.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import { createUrlEncodedTypeEncoder } from '../../src/encoder/url-encoded-type-encoder';
import data from '../data';

Expand Down
2 changes: 1 addition & 1 deletion tests/encoder/yaml-type-encoder.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test } from '@jest/globals';
import { describe, expect, test } from 'vitest';
import { createYamlTypeEncoder } from '../../src/encoder/yaml-type-encoder';
import data from '../data';

Expand Down
19 changes: 19 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['tests/**/*.test.*'],
coverage: {
all: true,
clean: true,
reporter: ['clover', ['html', { subdir: 'html' }], 'json', 'lcovonly', 'text'],
provider: 'v8',
thresholds: {
lines: 100,
},
include: ['src/**/*.ts'],
},
},
});

0 comments on commit 217a6dd

Please sign in to comment.