Skip to content

Commit

Permalink
Updates test suite to use vitest and imporoves typesafety
Browse files Browse the repository at this point in the history
  • Loading branch information
douglance committed Jun 17, 2022
1 parent 21e2a50 commit 5c10f43
Show file tree
Hide file tree
Showing 81 changed files with 48,720 additions and 35,908 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ jobs:
- name: Run linter
run: npm run lint

- name: Run tests
run: npm run test

- name: Build project
run: npm run build

# TODO: Separate the tests that can be run without a lattice
# and run those tests here.
# - name: Run tests
# run: npm run test
111 changes: 66 additions & 45 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,78 +1,99 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "test-all",
"type": "node",
"args": ["run", "${relativeFile}"],
"autoAttachChildProcesses": true,
"console": "integratedTerminal",
"name": "Debug Current Test File",
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
"request": "launch",
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"smartStep": true,
"type": "pwa-node"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test"],
"envFile": "${workspaceFolder}/.env",
"console": "integratedTerminal"
"name": "Unit Tests - All",
"request": "launch",
"runtimeArgs": ["run-script", "test"],
"runtimeExecutable": "npm",
"type": "node"
},
{
"name": "test-btc",
"type": "node",
"request": "launch",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test-btc"],
"envFile": "${workspaceFolder}/.env",
"console": "integratedTerminal"
"name": "E2E Tests - All",
"request": "launch",
"runtimeArgs": ["run-script", "test-e2e"],
"runtimeExecutable": "npm",
"type": "node"
},
{
"name": "test-eth-msg",
"type": "node",
"request": "launch",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test-eth-msg"],
"envFile": "${workspaceFolder}/.env",
"console": "integratedTerminal"
"name": "E2E Tests - General",
"request": "launch",
"runtimeArgs": ["run-script", "test-gen"],
"runtimeExecutable": "npm",
"type": "node"
},
{
"name": "test-kv",
"type": "node",
"request": "launch",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test-kv"],
"envFile": "${workspaceFolder}/.env",
"console": "integratedTerminal"
"name": "E2E Tests - Bitcoin",
"request": "launch",
"runtimeArgs": ["run-script", "test-btc"],
"runtimeExecutable": "npm",
"type": "node"
},
{
"name": "test-non-exportable",
"type": "node",
"request": "launch",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test-non-exportable"],
"envFile": "${workspaceFolder}/.env",
"console": "integratedTerminal"
"name": "E2E Tests - Signing",
"request": "launch",
"runtimeArgs": ["run-script", "test-sign"],
"runtimeExecutable": "npm",
"type": "node"
},
{
"name": "test-signing",
"type": "node",
"request": "launch",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test-signing"],
"envFile": "${workspaceFolder}/.env",
"console": "integratedTerminal"
"name": "E2E Tests - Key-Value",
"request": "launch",
"runtimeArgs": ["run-script", "test-kv"],
"runtimeExecutable": "npm",
"type": "node"
},
{
"name": "test-wallet-jobs",
"type": "node",
"request": "launch",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"envFile": "${workspaceFolder}/.env",
"name": "E2E Tests - Non-Exportable Card",
"request": "launch",
"runtimeArgs": ["run-script", "test-ne"],
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test-wallet-jobs"],
"type": "node"
},
{
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"envFile": "${workspaceFolder}/.env",
"console": "integratedTerminal"
"name": "E2E Tests - Wallet Jobs",
"request": "launch",
"runtimeArgs": ["run-script", "test-wj"],
"runtimeExecutable": "npm",
"type": "node"
}
]
],
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0"
}
2 changes: 1 addition & 1 deletion docs/docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The following options can be used after `env` with any test.
| `REUSE_KEY` | Must be `1` | Indicates we will be creating a new pairing with a Lattice and stashing that connection |
| `DEVICE_ID` | A six character string | The device ID of the target Lattice |
| `name` | Any 5-25 character string (default="SDK Test") | The name of the pairing you will create |
| `baseUrl` | Any URL (default="https://signing.gridplus.io") | URL describing where to send HTTP requests. Should be changed if your Lattice is on non-default message routing infrastructure. |
| `baseUrl` | Any URL (default="https://signing.gridpl.us") | URL describing where to send HTTP requests. Should be changed if your Lattice is on non-default message routing infrastructure. |

## Setting up the `.env` file

Expand Down
Loading

0 comments on commit 5c10f43

Please sign in to comment.