-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) Small bug fixes, refactors in workflow invocation based on Dann…
…y's tests (#14054)
- Loading branch information
Showing
9 changed files
with
5,041 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Run SDK Tests | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize] | ||
paths: | ||
- 'packages/sdk/**' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
working-directory: packages/sdk | ||
|
||
- name: Run tests | ||
run: npm test | ||
working-directory: packages/sdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
setupFiles: [ | ||
"<rootDir>/jest.setup.js", | ||
], | ||
roots: [ | ||
"<rootDir>/src", | ||
], | ||
testMatch: [ | ||
"**/__tests__/**/*.ts", | ||
"**/?(*.)+(spec|test).ts", | ||
], | ||
moduleFileExtensions: [ | ||
"ts", | ||
"js", | ||
], | ||
transform: { | ||
// '^.+\\.[tj]sx?$' to process ts,js,tsx,jsx with `ts-jest` | ||
// '^.+\\.m?[tj]sx?$' to process ts,js,tsx,jsx,mts,mjs,mtsx,mjsx with `ts-jest` | ||
"^.+\\.tsx?$": [ | ||
"ts-jest", | ||
{ | ||
tsconfig: "tsconfig.node.json", | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const fetchMock = require("jest-fetch-mock"); | ||
fetchMock.enableMocks(); | ||
global.fetch = fetchMock; |
Oops, something went wrong.