Skip to content

Commit 17ebf44

Browse files
authored
chore: tests using vitest (#3)
1 parent b29b6dc commit 17ebf44

36 files changed

+2081
-4526
lines changed

.circleci/config.yml

-109
This file was deleted.

.editorconfig

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
# http://editorconfig.org
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
24
root = true
35

46
[*]
5-
charset = utf-8
6-
end_of_line = lf
7-
indent_size = 2
87
indent_style = space
9-
insert_final_newline = true
10-
max_line_length = 80
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
1111
trim_trailing_whitespace = true
12-
13-
[*.md]
14-
max_line_length = 0
15-
trim_trailing_whitespace = false
12+
insert_final_newline = true

.eslintrc.json

+12-25
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
11
{
2-
"root": true,
3-
"parser": "@typescript-eslint/parser",
4-
"parserOptions": { "project": "./tsconfig.json" },
5-
"env": { "es6": true },
6-
"ignorePatterns": ["node_modules", "build", "coverage"],
7-
"plugins": ["import", "eslint-comments", "functional"],
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
6+
},
87
"extends": [
98
"eslint:recommended",
10-
"plugin:eslint-comments/recommended",
119
"plugin:@typescript-eslint/recommended",
12-
"plugin:import/typescript",
13-
"plugin:functional/lite",
1410
"prettier"
1511
],
16-
"globals": { "BigInt": true, "console": true, "WebAssembly": true },
12+
"parser": "@typescript-eslint/parser",
13+
"parserOptions": {
14+
"ecmaVersion": "latest",
15+
"sourceType": "module"
16+
},
17+
"plugins": ["@typescript-eslint", "prettier"],
1718
"rules": {
18-
"functional/no-return-void": "off",
19-
"@typescript-eslint/explicit-module-boundary-types": "off",
20-
"eslint-comments/disable-enable-pair": [
21-
"error",
22-
{ "allowWholeFile": true }
23-
],
24-
"eslint-comments/no-unused-disable": "error",
25-
"import/order": [
26-
"error",
27-
{ "newlines-between": "always", "alphabetize": { "order": "asc" } }
28-
],
29-
"sort-imports": [
30-
"error",
31-
{ "ignoreDeclarationSort": true, "ignoreCase": true }
32-
]
19+
"prettier/prettier": "error"
3320
}
3421
}

.github/workflows/check-pr.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Check PR
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
check-pr:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Use Node.js LTS
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: lts/*
19+
20+
- name: Install dependencies (with cache)
21+
uses: bahmutov/npm-install@HEAD
22+
23+
- name: Check types
24+
run: yarn build
25+
26+
- name: Check linting
27+
run: yarn lint
28+
29+
- name: Check commits messages
30+
uses: wagoid/commitlint-github-action@v4
31+
32+
tests:
33+
runs-on: ubuntu-latest
34+
35+
needs: check-pr
36+
37+
strategy:
38+
matrix:
39+
node-version: [14.x, 16.x, 18.x]
40+
41+
steps:
42+
- uses: actions/checkout@v3
43+
44+
- name: Use Node.js ${{ matrix.node-version }}
45+
uses: actions/setup-node@v3
46+
with:
47+
node-version: ${{ matrix.node-version }}
48+
49+
- name: Install dependencies (with cache)
50+
uses: bahmutov/npm-install@HEAD
51+
52+
- name: Run Tests
53+
run: yarn test

.github/workflows/release.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Runs All Unit tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- next
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: lts/*
23+
24+
- name: Install dependencies (with cache)
25+
uses: bahmutov/npm-install@HEAD
26+
27+
- name: Run Tests
28+
run: yarn test
29+
30+
- name: Run Semantic-Release
31+
run: yarn release

0 commit comments

Comments
 (0)