Skip to content

Commit

Permalink
fix: fix test bug, update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
2214962083 committed Apr 27, 2022
1 parent fd2e8c0 commit cb30319
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
registry-url: https://registry.npmjs.org/
cache: pnpm

- run: pnpm install
- run: pnpm bootstrap

- name: build docs
run: pnpm run build --filter doc-site
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
registry-url: https://registry.npmjs.org/
cache: pnpm

- run: pnpm install
- run: pnpm bootstrap

- name: Lint
run: pnpm run lint
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Install Dependencies
run: pnpm install
run: pnpm bootstrap

- name: PNPM build
run: pnpm run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
registry-url: https://registry.npmjs.org/
cache: pnpm

- run: pnpm install
- run: pnpm bootstrap

- name: Build
run: pnpm run build
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"originjs",
"outfile",
"OVSX",
"paramtypes",
"persistedstate",
"pinzhi",
"pnpm",
Expand All @@ -168,6 +169,7 @@
"rangeyearprops",
"redrun",
"respawn",
"returntype",
"scripthost",
"segi",
"selectdateprops",
Expand Down
4 changes: 2 additions & 2 deletions packages/class-mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"build": "pnpm type-check &&esno ./scripts/build.ts",
"build:watch": "cross-env WATCH=true pnpm build",
"clean": "rimraf ./dist/**/*",
"dev": "vite",
"test": "vitest run --silent",
"dev": "esno ./src/index.ts",
"test": "vitest run --silent --passWithNoTests",
"test:watch": "pnpm test -- --watch",
"type-check": "tsc --noEmit"
},
Expand Down
7 changes: 0 additions & 7 deletions packages/class-mock/src/index.spec.ts

This file was deleted.

17 changes: 15 additions & 2 deletions packages/class-mock/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
export const say = () => 'hello mock'
import 'reflect-metadata'

say()
@Reflect.metadata('type', 'class')
class A {
constructor(public name: string, public age: number) {}
@Reflect.metadata(undefined, undefined)
method(): boolean {
return true
}
}

const t1 = Reflect.getMetadata('design:paramtypes', A)
const t2 = Reflect.getMetadata('design:returntype', A.prototype, 'method')
const t3 = Reflect.getMetadata('design:type', A.prototype, 'method')

console.log(...t1, t2, t3)

0 comments on commit cb30319

Please sign in to comment.