Skip to content

Commit cb30319

Browse files
committed
fix: fix test bug, update github actions
1 parent fd2e8c0 commit cb30319

File tree

8 files changed

+23
-15
lines changed

8 files changed

+23
-15
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
registry-url: https://registry.npmjs.org/
2929
cache: pnpm
3030

31-
- run: pnpm install
31+
- run: pnpm bootstrap
3232

3333
- name: build docs
3434
run: pnpm run build --filter doc-site

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
registry-url: https://registry.npmjs.org/
2929
cache: pnpm
3030

31-
- run: pnpm install
31+
- run: pnpm bootstrap
3232

3333
- name: Lint
3434
run: pnpm run lint

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}
3030

3131
- name: Install Dependencies
32-
run: pnpm install
32+
run: pnpm bootstrap
3333

3434
- name: PNPM build
3535
run: pnpm run build

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
registry-url: https://registry.npmjs.org/
3535
cache: pnpm
3636

37-
- run: pnpm install
37+
- run: pnpm bootstrap
3838

3939
- name: Build
4040
run: pnpm run build

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
"originjs",
151151
"outfile",
152152
"OVSX",
153+
"paramtypes",
153154
"persistedstate",
154155
"pinzhi",
155156
"pnpm",
@@ -168,6 +169,7 @@
168169
"rangeyearprops",
169170
"redrun",
170171
"respawn",
172+
"returntype",
171173
"scripthost",
172174
"segi",
173175
"selectdateprops",

packages/class-mock/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"build": "pnpm type-check &&esno ./scripts/build.ts",
1919
"build:watch": "cross-env WATCH=true pnpm build",
2020
"clean": "rimraf ./dist/**/*",
21-
"dev": "vite",
22-
"test": "vitest run --silent",
21+
"dev": "esno ./src/index.ts",
22+
"test": "vitest run --silent --passWithNoTests",
2323
"test:watch": "pnpm test -- --watch",
2424
"type-check": "tsc --noEmit"
2525
},

packages/class-mock/src/index.spec.ts

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

packages/class-mock/src/index.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
export const say = () => 'hello mock'
1+
import 'reflect-metadata'
22

3-
say()
3+
@Reflect.metadata('type', 'class')
4+
class A {
5+
constructor(public name: string, public age: number) {}
6+
@Reflect.metadata(undefined, undefined)
7+
method(): boolean {
8+
return true
9+
}
10+
}
11+
12+
const t1 = Reflect.getMetadata('design:paramtypes', A)
13+
const t2 = Reflect.getMetadata('design:returntype', A.prototype, 'method')
14+
const t3 = Reflect.getMetadata('design:type', A.prototype, 'method')
15+
16+
console.log(...t1, t2, t3)

0 commit comments

Comments
 (0)