Compare commits
5 Commits
0.1.39
...
9763964007
| Author | SHA1 | Date | |
|---|---|---|---|
|
9763964007
|
|||
|
4cb5e68dd7
|
|||
|
0cd32ffb5e
|
|||
| 39e952658b | |||
| d69250fd75 |
@@ -0,0 +1,7 @@
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
|
||||
@@ -8,7 +8,7 @@ jobs:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
name: Check Dist
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
name: Dry-Run
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
name: Dry-Run Prerelease
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"semi": true,
|
||||
"trailingComma": "es5",
|
||||
"singleQuote": false,
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false
|
||||
}
|
||||
Vendored
+46
-82
File diff suppressed because one or more lines are too long
@@ -1,13 +0,0 @@
|
||||
module.exports = {
|
||||
preset: "ts-jest",
|
||||
testEnvironment: "node",
|
||||
roots: ["<rootDir>/src"],
|
||||
testMatch: ["**/*.spec.ts"],
|
||||
moduleNameMapper: {
|
||||
"^@actions/core$": "<rootDir>/src/__mocks__/actions-core.ts",
|
||||
},
|
||||
transform: {
|
||||
"^.+\\.ts$": "ts-jest",
|
||||
},
|
||||
moduleFileExtensions: ["ts", "js", "json"],
|
||||
};
|
||||
Generated
+1851
-4467
File diff suppressed because it is too large
Load Diff
+8
-9
@@ -4,21 +4,20 @@
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "esbuild src/index.ts --bundle --outfile=dist/index.js --platform=node --target=node24 --minify",
|
||||
"test": "jest",
|
||||
"format": "prettier --write src/**/*.ts"
|
||||
"build": "rolldown -c",
|
||||
"test": "vitest",
|
||||
"format": "oxfmt --write src/**/*.ts"
|
||||
},
|
||||
"author": "Timo Behrendt <t.behrendt@t00n.de>",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/conventional-commits-parser": "5.0.2",
|
||||
"@types/jest": "30.0.0",
|
||||
"@types/node": "24.13.2",
|
||||
"esbuild": "0.28.1",
|
||||
"jest": "30.4.2",
|
||||
"prettier": "3.8.4",
|
||||
"ts-jest": "29.4.11",
|
||||
"typescript": "5.9.3"
|
||||
"@vitest/coverage-v8": "4.1.10",
|
||||
"oxfmt": "0.59.0",
|
||||
"rolldown": "1.2.0",
|
||||
"typescript": "5.9.3",
|
||||
"vitest": "4.1.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "3.0.1",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { defineConfig } from "rolldown/config";
|
||||
|
||||
export default defineConfig({
|
||||
input: "src/index.ts",
|
||||
output: {
|
||||
file: "dist/index.js",
|
||||
format: "esm",
|
||||
minify: true,
|
||||
},
|
||||
platform: "node",
|
||||
treeshake: true,
|
||||
});
|
||||
@@ -1,5 +0,0 @@
|
||||
export const getInput = jest.fn(() => "");
|
||||
export const info = jest.fn();
|
||||
export const warning = jest.fn();
|
||||
export const setOutput = jest.fn();
|
||||
export const setFailed = jest.fn();
|
||||
+12
-12
@@ -1,22 +1,24 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi, type MockedFunction } from "vitest";
|
||||
|
||||
import {
|
||||
IncrementType,
|
||||
Tag,
|
||||
GitService,
|
||||
CoreService,
|
||||
ConventionalCommitAnalyzer,
|
||||
TagService,
|
||||
TagIncrementer,
|
||||
LocalGitService,
|
||||
CoreService,
|
||||
GitService,
|
||||
IncrementType,
|
||||
LocalCoreService,
|
||||
LocalGitService,
|
||||
Tag,
|
||||
TagIncrementer,
|
||||
TagService,
|
||||
} from "./main";
|
||||
|
||||
// Mock child_process.execSync
|
||||
jest.mock("child_process", () => ({
|
||||
execSync: jest.fn(),
|
||||
vi.mock("child_process", () => ({
|
||||
execSync: vi.fn(),
|
||||
}));
|
||||
|
||||
import { execSync } from "child_process";
|
||||
const mockExecSync = execSync as jest.MockedFunction<typeof execSync>;
|
||||
const mockExecSync = execSync as MockedFunction<typeof execSync>;
|
||||
|
||||
// Mock interfaces for testing
|
||||
class MockGitService implements GitService {
|
||||
@@ -439,8 +441,6 @@ describe("LocalCoreService", () => {
|
||||
localCoreService = new LocalCoreService();
|
||||
});
|
||||
|
||||
// @actions/core is mocked via jest.config.js moduleNameMapper
|
||||
|
||||
it("should have all required methods", () => {
|
||||
expect(typeof localCoreService.getInput).toBe("function");
|
||||
expect(typeof localCoreService.info).toBe("function");
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
environment: "node",
|
||||
include: ["src/**/*.{spec,test}.ts"],
|
||||
coverage: {
|
||||
enabled: true,
|
||||
provider: "v8",
|
||||
include: ["src/**/*.ts"],
|
||||
exclude: ["src/**/*.{spec,test}.ts"],
|
||||
reporter: ["lcov"],
|
||||
reportsDirectory: "coverage",
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user