Skip to content

Commit

Permalink
(fix) Small bug fixes, refactors in workflow invocation based on Dann…
Browse files Browse the repository at this point in the history
…y's tests (#14054)
  • Loading branch information
dylburger authored Sep 23, 2024
1 parent c335bd6 commit 6a7ab4f
Show file tree
Hide file tree
Showing 9 changed files with 5,041 additions and 260 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/pipedream-sdk-test.yaml
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
28 changes: 28 additions & 0 deletions packages/sdk/jest.config.js
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",
},
],
},
};
3 changes: 3 additions & 0 deletions packages/sdk/jest.setup.js
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;
Loading

0 comments on commit 6a7ab4f

Please sign in to comment.