Skip to content

Commit

Permalink
revert for v3 and stop use process exit
Browse files Browse the repository at this point in the history
  • Loading branch information
xrutayisire committed Jan 16, 2025
1 parent bfb3ad1 commit 154f45d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/actions/restore-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ runs:
steps:
- name: Cache node_modules
id: cache-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
node_modules
Expand All @@ -14,15 +14,15 @@ runs:
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-dependencies
- name: Cache artifacts
id: cache-artifacts
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
packages/*/dist
packages/core/build
key: ${{ runner.os }}-${{ github.run_id }}-artifacts
- name: Cache playwright binaries
id: cache-playwright-binaries
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ runs:
using: composite
steps:
- name: Use Node.js LTS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: yarn
node-version: lts/*
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache node_modules and artifacts
uses: ./.github/actions/restore-cache
Expand All @@ -25,7 +25,7 @@ jobs:
runs-on: [windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache node_modules and artifacts
uses: ./.github/actions/restore-cache
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Restore cache
uses: ./.github/actions/restore-cache
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:

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

- name: Restore cache
uses: ./.github/actions/restore-cache
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:

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

- name: Restore cache
uses: ./.github/actions/restore-cache
Expand Down
4 changes: 3 additions & 1 deletion packages/init/src/SliceMachineInitProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,9 @@ Continue with next steps in Slice Machine.
)} ${chalk.cyan(tryAgainCommand)}`,
);

throw error;
process.off("uncaughtException", () => {
process.exitCode = 1;
});
});

this.context.installProcess = execaProcess;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ it("catches early core dependencies installation process errors", async () => {
// @ts-expect-error - Accessing protected property
expect(initProcess.context.installProcess).toBeTypeOf("object");

vi.stubGlobal("process", { ...process, exit: vi.fn() });
vi.stubGlobal("process", { ...process, off: vi.fn() });

const { stderr } = await watchStd(async () => {
// @ts-expect-error - Accessing protected property
Expand Down Expand Up @@ -75,7 +75,7 @@ it("catches early core dependencies installation process errors", async () => {
error: expect.any(String),
}),
);
expect(process.exit).toHaveBeenCalledOnce();
expect(process.off).toHaveBeenCalledOnce();
expect(stderr[0]).toMatch(/Dependency installation failed/);
});

Expand All @@ -95,7 +95,7 @@ it("appends repository selection to error message when core dependencies install
// @ts-expect-error - Accessing protected property
expect(initProcess.context.installProcess).toBeTypeOf("object");

vi.stubGlobal("process", { ...process, exit: vi.fn() });
vi.stubGlobal("process", { ...process, off: vi.fn() });

const { stderr } = await watchStd(async () => {
// @ts-expect-error - Accessing protected property
Expand Down

0 comments on commit 154f45d

Please sign in to comment.