Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run SDK Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'pnpm'

- name: Install SDK deps
run: pnpm --filter @mintlayer/sdk install

- name: Run SDK tests
run: pnpm --filter @mintlayer/sdk run test
9 changes: 9 additions & 0 deletions packages/sdk/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// jest.config.js
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/jest.setup.ts'],
moduleNameMapper: {
'^@mintlayer/wasm-lib$': '<rootDir>/tests/__mocks__/@mintlayer/wasm-lib.ts',
},
};
3 changes: 3 additions & 0 deletions packages/sdk/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import fetchMock from 'jest-fetch-mock';
import 'whatwg-fetch';
fetchMock.enableMocks();
Loading