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

Add Test Suite, Achieve 80% Coverage #41

Merged
merged 11 commits into from
Dec 5, 2024
7 changes: 4 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: TypeScript Lint
on:
push:
branches:
- master
- main
pull_request:

permissions:
Expand All @@ -17,8 +17,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
Copy link
Contributor Author

@ProfMoo ProfMoo Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to bump this so that I can use the most recent versions of chai. I was running into some ESModule/Common tsconfig.json issues without it.

If this is undesired, we can try to revert and look deeper into why I was running into interop issues. Can get tricky 😬.

node-version: "23.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- name: Run npm ci
run: npm ci
- name: Run linter
run: npm run lint
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "23.x"
registry-url: "https://registry.npmjs.org"

- name: Publish to NPM
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: TypeScript Test

on:
push:
branches:
- main
pull_request:

jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "23.x"
registry-url: "https://registry.npmjs.org"
- name: Run npm ci
run: npm ci
- name: Run tests
run: npm run test
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ dist/

node_modules/

# VSCode configuration
.vscode

docs/**/*.json

# code coverage output
coverage
.nyc_output
6 changes: 6 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"require": [
"ts-node/register"
],
"spec": "src/**/*.test.ts"
}
20 changes: 20 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"all": true,
"include": [
"src/**/*.ts"
],
"exclude": [
"src/**/*.test.ts",
"src/**/index.ts",
"node_modules",
"src/gen"
],
"reporter": [
"text",
"html"
],
"check-coverage": true,
"lines": 80,
"statements": 80
}
36 changes: 36 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"markdownlint.config": {
"MD033": false,
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": false,
"files.autoSave": "onFocusChange",
"cSpell.words": [
"automerge",
"holesky",
"nonroutine",
"solana",
"txsigner",
"unstake"
],
"typescript.updateImportsOnFileMove.enabled": "always",
"javascript.updateImportsOnFileMove.enabled": "always",
"vs-code-prettier-eslint.prettierLast": false,
"[javascript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"files.insertFinalNewline": true,
}
Loading
Loading