Skip to content

Commit 7c5ba11

Browse files
authored
fix: stacktrace handler with updated dependecies (#32)
1 parent 727f78b commit 7c5ba11

34 files changed

Lines changed: 219 additions & 194 deletions

.github/workflows/ci.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ jobs:
153153
with:
154154
persist-credentials: false
155155

156+
- name: Set up node@24
157+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
158+
with:
159+
node-version: 24
160+
156161
- name: Set up bun@latest
157162
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
158163

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ echo
5252

5353
# Check lint
5454
printSubHeader "Check lint on staged files..."
55-
bun biome lint --fix --staged --no-errors-on-unmatched
55+
bunx biome lint --fix --staged --no-errors-on-unmatched
5656
printPassed "Lint"
5757

5858
# Reindex staged files

__tests__/__example/example.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { join } from 'node:path';
22
import { TypesTesting } from 'src';
33
import exampleModule from './example-module';
4-
import * as ExampleTypes from './example-types';
4+
import type * as ExampleTypes from './example-types';
55

66
if (process.versions.bun) {
77
let bunTest = (await import('bun:test')).default;
@@ -38,16 +38,12 @@ describe('example-module', () => {
3838
test(`exampleModule.getName type is function without parameter and return 'example-module'`, () => {
3939
// using runtime argument
4040
expectType(exampleModule.getName).toBe<() => 'example-module'>();
41-
expectType(exampleModule.getName).toBe<{
42-
(): 'example-module';
43-
}>();
41+
expectType(exampleModule.getName).toBe<() => 'example-module'>();
4442
expectType(exampleModule.getName()).toBe<'example-module'>();
4543

4644
// using type argument
4745
expectType<typeof exampleModule.getName>().toBe<() => 'example-module'>();
48-
expectType<typeof exampleModule.getName>().toBe<{
49-
(): 'example-module';
50-
}>();
46+
expectType<typeof exampleModule.getName>().toBe<() => 'example-module'>();
5147
expectType<
5248
ReturnType<typeof exampleModule.getName>
5349
>().toBe<'example-module'>();

__tests__/__example/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type JestConfigWithTsJest, createJsWithTsEsmPreset } from 'ts-jest';
1+
import { createJsWithTsEsmPreset, type JestConfigWithTsJest } from 'ts-jest';
22

33
const presetConfig = createJsWithTsEsmPreset({
44
tsconfig: '__tests__/__example/tsconfig.jest.json'

__tests__/__example/tsconfig.jest.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4+
"ignoreDeprecations": "6.0",
45
"module": "ESNext",
56
"target": "ESNext",
67
"isolatedModules": true,
78
"esModuleInterop": true,
8-
"outDir": "."
9+
"outDir": ".",
10+
"rootDir": "../../"
911
},
1012
"files": ["example.test.ts"],
1113
"include": ["../../src"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
export default defineConfig({
4+
resolve: {
5+
tsconfigPaths: true
6+
}
7+
});

__tests__/__integrations/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type JestConfigWithTsJest, createJsWithTsEsmPreset } from 'ts-jest';
1+
import { createJsWithTsEsmPreset, type JestConfigWithTsJest } from 'ts-jest';
22

33
const presetConfig = createJsWithTsEsmPreset({
44
tsconfig: '__tests__/__integrations/tsconfig.jest.json'

__tests__/__integrations/jest.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ if (process.versions.bun) {
2424
meta: Record<string, unknown>;
2525
}[];
2626
}[];
27-
} =
28-
await Bun.$`node --experimental-vm-modules node_modules/jest/bin/jest.js jest.test.ts -c=__tests__/__integrations/jest.config.ts --json`
29-
.nothrow()
30-
.json();
27+
} = await Bun.$`bun test:integrations:jest --json`.nothrow().json();
3128

3229
describe('jest', () => {
3330
test('successfully run in jest', () => {

__tests__/__integrations/test-case.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ const prepareThrowMessage = (fnName: string) => {
2525
};
2626
};
2727

28-
export const testCase = (
28+
export const testCase = <T extends import('@jest/expect').JestExpect>(
2929
describe: (label: string, fn: () => void) => void,
3030
test:
3131
| import('vitest').TestAPI
32-
| import('bun:test').Test
32+
| import('bun:test').Test<unknown[]>
3333
| import('@jest/types').Global.ItConcurrent,
34-
expect:
35-
| import('vitest').ExpectStatic
36-
| import('bun:test').Expect
37-
| import('@jest/expect').JestExpect
34+
expect: T
3835
) => {
3936
describe('toBeAny', () => {
4037
const throwMessage = prepareThrowMessage('toBeAny');

__tests__/__integrations/tsconfig.jest.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4+
"ignoreDeprecations": "6.0",
45
"module": "ESNext",
56
"target": "ESNext",
67
"isolatedModules": true,
78
"esModuleInterop": true,
8-
"outDir": "."
9+
"outDir": ".",
10+
"rootDir": "../../"
911
},
1012
"files": ["jest.test.ts", "test-case.ts"],
1113
"include": ["../../src"]

0 commit comments

Comments
 (0)