Skip to content

Commit

Permalink
chore: couple changes
Browse files Browse the repository at this point in the history
  • Loading branch information
petertonysmith94 committed Dec 10, 2024
1 parent 2edccc6 commit dbd3c9d
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion packages/fuel-gauge/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"types": ["vitest/globals", "@fuel-ts/utils/global"]
"types": ["vitest/globals", "@fuel-ts/utils/test-utils"]
},
"include": ["src", "test"]
}
13 changes: 0 additions & 13 deletions packages/utils/global.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/utils/src/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './test-utils/getForcProject';
export * from './test-utils/expectToBeInRange';
export * from './test-utils/constants';
export * from './test-utils/wait-until-unreachable';
export * from './test-utils/vitest.matchers';
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { bn } from '@fuel-ts/math';
import type { BNInput } from '@fuel-ts/math';
import type { BN, BNInput } from '@fuel-ts/math';

interface Matchers<R = BN> {
toEqualBn: (expected: BNInput) => R;
}

declare module 'vitest' {
interface Assertion extends Matchers {}
interface AsymmetricMatchersContaining extends Matchers {}
interface ExpectStatic {
toEqualBn(expected: BNInput): BN;
}
}

export const setupTestMatchers = () => {
expect.extend({
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"compilerOptions": {
"outDir": "./dist"
},
"include": ["src", "test", "global.d.ts"]
"include": ["src", "test"]
}
3 changes: 0 additions & 3 deletions packages/utils/vitest.setup.ts

This file was deleted.

3 changes: 3 additions & 0 deletions vitest.setup-files.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { setupTestMatchers } from '@fuel-ts/utils/test-utils';

setupTestMatchers();
2 changes: 1 addition & 1 deletion vitest.shared.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineConfig({
esbuild: { target: "es2022" },
test: {
globalSetup: ["vitest.global-setup.ts"],
setupFiles: ["./packages/utils/vitest.setup.ts"],
setupFiles: ["./vitest.setup-files.ts"],
coverage: {
enabled: true,
provider: "istanbul",
Expand Down

0 comments on commit dbd3c9d

Please sign in to comment.