Skip to content

Commit 3ff6c3b

Browse files
committed
refactor: remove Rollup configuration and add Vitest tests
- Deleted rollup.config.js as it is no longer needed. - Added main.test.ts to test the main functionality of the application. - Added wait.test.ts to test the wait function. - Created tsconfig.build.json for build-specific TypeScript configuration. - Updated tsconfig.json to include test files and Vitest types. - Added vitest.config.js for Vitest configuration with coverage reporting.
1 parent 6a7f86c commit 3ff6c3b

24 files changed

Lines changed: 8377 additions & 15799 deletions

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Testing
44

5-
This project uses jest for testing.
5+
This project uses vitest for testing.
66

7-
- **Mocking:** Always use 'jest-mock' mocking when mocking in tests.
7+
- **Mocking:** Always use 'vi.mocked' mocking when mocking in tests.
88

99
# File Naming Conventions
1010

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
- name: Autobuild
4040
uses: github/codeql-action/autobuild@v3
4141

42-
- name: Perform CodeQL Analysis
42+
- name: Run CodeQL Scanner
4343
uses: github/codeql-action/analyze@v3
4444
# -------------------------------------------------------------
45-
# Alternative: Reusable workflow for code scanning
45+
# Alternative: pixpilot/codeql-scanner@main
4646
# -------------------------------------------------------------
4747
# Use this ONLY if your repo is private and you do NOT have GitHub Enterprise.
4848
# The official CodeQL workflow (see above) is always preferred for security and
@@ -55,8 +55,8 @@ jobs:
5555
# - name: Checkout repository
5656
# uses: actions/checkout@v4
5757

58-
# - name: Perform CodeQL Analysis
59-
# uses: pixpilot/github/actions/codeql-analyzer@main
58+
# - name: Run CodeQL Scanner
59+
# uses: pixpilot/codeql-scanner@main
6060
# with:
6161
# token: ${{ secrets.GITHUB_TOKEN }}
6262
# config-file: .github/codeql/codeql-config.yml

.licensed.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ allowed:
1414

1515
ignored:
1616
npm:
17-
# Used by Rollup.js when building in GitHub Actions
18-
- '@rollup/rollup-linux-x64-gnu'
17+
# Used by ESBuild when building in GitHub Actions
18+
- '@esbuild/linux-x64'

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

__fixtures__/core.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

__fixtures__/wait.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

__mocks__/@actions/core/index.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

__mocks__/core.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* This file is used to mock the `@actions/core` module in tests.
3+
*/
4+
import { vi } from 'vitest';
5+
6+
export const debug = vi.fn() as ReturnType<typeof vi.mocked<(message: string) => void>>;
7+
export const error = vi.fn() as ReturnType<
8+
typeof vi.mocked<(message: string | Error) => void>
9+
>;
10+
export const info = vi.fn() as ReturnType<typeof vi.mocked<(message: string) => void>>;
11+
export const getInput = vi.fn() as ReturnType<
12+
typeof vi.mocked<(name: string, options?: object) => string>
13+
>;
14+
export const setOutput = vi.fn() as ReturnType<
15+
typeof vi.mocked<(name: string, value: string | number | boolean) => void>
16+
>;
17+
export const setFailed = vi.fn() as ReturnType<
18+
typeof vi.mocked<(message: string | Error) => void>
19+
>;
20+
export const warning = vi.fn() as ReturnType<
21+
typeof vi.mocked<(message: string | Error) => void>
22+
>;

__tests__/main.test.ts

Lines changed: 0 additions & 60 deletions
This file was deleted.

__tests__/wait.test.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)