Skip to content

Commit

Permalink
feat: use beta version of mock-github to support mocking of node's na…
Browse files Browse the repository at this point in the history
…tive fetch client (#82)

BREAKING CHANGE: Add support for mocking node's native fetch client. Requires node 18 or higher
  • Loading branch information
shubhbapna authored Jul 17, 2024
1 parent e5df6b7 commit 7c311fa
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- run: npm install
- run: npm run test:ci
- run: |
npm run test:ci
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install packages
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
unit:
strategy:
matrix:
node-version: [16.x]
node-version: [18.x, 20.x, 22.x]
fail-fast: false
runs-on: ubuntu-latest
steps:
Expand All @@ -33,7 +33,7 @@ jobs:
integration:
strategy:
matrix:
node-version: [16.x]
node-version: [18.x, 20.x, 22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand All @@ -57,7 +57,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x

- name: Install packages
run: npm ci
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# act-js

> **Notice**
>
> We have introduced experimental support for fetch in mock-github. This is a release of act-js with the beta version of mock-github. You can install it by:
>
> ```
> npm install @kie/act-js@beta
> ```

Installs [nektos/act](https://github.com/nektos/act) and provides access to it as a CLI as well as an API

## Table of Content
Expand Down
53 changes: 43 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"typescript": "^4.7.4"
},
"dependencies": {
"@kie/mock-github": "^2.0.0",
"@kie/mock-github": "^3.0.0-beta.1",
"adm-zip": "^0.5.10",
"ajv": "^8.12.0",
"bin-links": "^4.0.1",
Expand All @@ -76,6 +76,9 @@
"tar": "^6.1.13",
"yaml": "^2.1.3"
},
"engines": {
"node": ">=18"
},
"jestSonar": {
"reportPath": "coverage"
},
Expand Down
2 changes: 1 addition & 1 deletion test/ci/pull_request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ afterEach(async () => {
test("pull request workflow", async () => {

const act = new Act(github.repo.getPath("pull_request"));
const result = await act.setMatrix("node-version", ["16.x"]).runJob("unit", {
const result = await act.setMatrix("node-version", ["18.x"]).runJob("unit", {
mockSteps: {
unit: [
{
Expand Down

0 comments on commit 7c311fa

Please sign in to comment.