Skip to content

Commit

Permalink
ci: bench-d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Jun 23, 2024
1 parent 789091f commit ecc5e5f
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ jobs:
- name: Link packages
run: pnpm preconstruct

- name: Test types
run: pnpm test:types

- name: Check types
run: pnpm typecheck

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"test": "vitest",
"test:build": "pnpm run --r --parallel test:build",
"test:cov": "vitest run --coverage",
"test:typecheck": "vitest typecheck",
"test:types": "TYPES=true vitest bench-d.ts",
"test:update": "vitest --update",
"trace": "tsc --noEmit --generateTrace ./playgrounds/performance/out --incremental false --project playgrounds/performance/tsconfig.json && echo \"Open playgrounds/performance/out/trace.json in https://ui.perfetto.dev\"",
"typecheck": "pnpm run --r --parallel typecheck && tsc --noEmit",
Expand Down
7 changes: 6 additions & 1 deletion packages/abitype/jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
},
"publish": {
"include": ["LICENSE", "README.md", "CHANGELOG.md", "src/**/*.ts"],
"exclude": ["src/**/*.bench.ts", "src/**/*.test.ts", "src/**/*.test-d.ts"]
"exclude": [
"src/**/*.bench.ts",
"src/**/*.bench-d.ts",
"src/**/*.test.ts",
"src/**/*.test-d.ts"
]
}
}
5 changes: 3 additions & 2 deletions packages/abitype/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
"!dist/**/*.tsbuildinfo",
"!jsr.json",
"!src/**/*.bench.ts",
"!src/**/*.test-d.ts",
"!src/**/*.test.ts"
"!src/**/*.bench-d.ts",
"!src/**/*.test.ts",
"!src/**/*.test-d.ts"
],
"sideEffects": false,
"type": "module",
Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions packages/abitype/src/utils.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertType, expectTypeOf, test } from 'vitest'
import { assertType, describe, expectTypeOf, test } from 'vitest'

import type { Abi } from './abi.js'
import type {
Expand Down Expand Up @@ -30,7 +30,7 @@ import type {

const zeroAddress = '0x0000000000000000000000000000000000000000'

test('AbiTypeToPrimitiveType', () => {
describe('AbiTypeToPrimitiveType', () => {
test('address', () => {
assertType<AbiTypeToPrimitiveType<'address'>>(zeroAddress)
})
Expand Down Expand Up @@ -92,7 +92,7 @@ test('AbiTypeToPrimitiveType', () => {
})
})

test('AbiParameterToPrimitiveType', () => {
describe('AbiParameterToPrimitiveType', () => {
test('address', () => {
type Result = AbiParameterToPrimitiveType<{
name: 'owner'
Expand Down Expand Up @@ -421,7 +421,7 @@ test('AbiParameterToPrimitiveType', () => {
})
})

test('AbiParametersToPrimitiveTypes', () => {
describe('AbiParametersToPrimitiveTypes', () => {
test('no parameters', () => {
type Result = AbiParametersToPrimitiveTypes<[]>
assertType<Result>([])
Expand Down Expand Up @@ -519,7 +519,7 @@ test('AbiParametersToPrimitiveTypes', () => {
})
})

test('IsAbi', () => {
describe('IsAbi', () => {
test('const assertion', () => {
assertType<IsAbi<typeof nestedTupleArrayAbi>>(true)
assertType<IsAbi<typeof wagmiMintExampleAbi>>(true)
Expand Down Expand Up @@ -562,7 +562,7 @@ test('IsAbi', () => {
})
})

test('Function', () => {
describe('Function', () => {
test('ExtractAbiFunctions', () => {
const abiFunction = {
type: 'function',
Expand Down Expand Up @@ -628,7 +628,7 @@ test('Function', () => {
})
})

test('Events', () => {
describe('Events', () => {
test('ExtractAbiEvents', () => {
const abiEvent = {
type: 'event',
Expand Down Expand Up @@ -672,7 +672,7 @@ test('Events', () => {
})
})

test('Error', () => {
describe('Error', () => {
test('ExtractAbiErrors', () => {
const abiError = {
type: 'error',
Expand Down Expand Up @@ -708,7 +708,7 @@ test('Error', () => {
})
})

test('TypedDataToPrimitiveTypes', () => {
describe('TypedDataToPrimitiveTypes', () => {
const contributor = {
name: 'John Doe',
address: '0x0000000000000000000000000000000000000000' as const,
Expand Down
7 changes: 6 additions & 1 deletion packages/abitype/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.bench.ts", "src/**/*.test.ts", "src/**/*.test-d.ts"],
"exclude": [
"src/**/*.bench.ts",
"src/**/*.bench-d.ts",
"src/**/*.test.ts",
"src/**/*.test-d.ts"
],
"compilerOptions": {
"sourceMap": true
}
Expand Down
7 changes: 6 additions & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@ export default defineConfig({
'**/dist/**',
'**/test/**',
'**/*.bench.ts',
'**/*.bench-d.ts',
'**/*.test.ts',
'**/*.test-d.ts',
'src/version.ts',
],
reporter: process.env.CI ? ['lcov'] : ['text', 'json', 'html'],
},
environment: 'node',
globalSetup: ['./test/globalSetup.ts'],
globalSetup: process.env.TYPES ? ['./test/globalSetup.ts'] : undefined,
include: [
...(process.env.TYPES ? ['**/*.bench-d.ts'] : []),
'**/*.test.ts',
],
root: './packages/abitype',
setupFiles: ['./test/setup.ts'],
},
Expand Down

0 comments on commit ecc5e5f

Please sign in to comment.