Skip to content

Commit

Permalink
chore: enable eslint vitest preset for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
faergeek committed Jun 16, 2024
1 parent 0d89c35 commit f6cc577
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
{
"files": "**/*.ts?(x)",
"extends": "@faergeek/eslint-config/typescript"
},
{
"files": "**/*.spec.ts?(x)",
"extends": "@faergeek/eslint-config/vitest"
}
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"devDependencies": {
"@commitlint/cli": "^19.0.0",
"@commitlint/config-conventional": "^19.0.0",
"@faergeek/eslint-config": "^6.0.0",
"@faergeek/eslint-config": "^6.1.0",
"@types/node": "^20.11.16",
"eslint": "^8.56.0",
"prettier": "^3.2.5",
Expand Down
36 changes: 31 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/async.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Async', () => {
});

expectTypeOf(matched).toEqualTypeOf<undefined>();
expect(matched).toBe(undefined);
expect(matched).toBeUndefined();
});

it('.Ready', () => {
Expand Down Expand Up @@ -84,6 +84,6 @@ describe('Async', () => {
.toNullable();

expectTypeOf(notAll).toEqualTypeOf<{ 42: number; none: never } | null>();
expect(notAll).toBe(null);
expect(notAll).toBeNull();
});
});
6 changes: 3 additions & 3 deletions src/maybe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('Maybe', () => {

const noneValue = Maybe.None.toNullable();
expectTypeOf(noneValue).toEqualTypeOf<null>();
expect(noneValue).toBe(null);
expect(noneValue).toBeNull();
});

it('#toOptional', () => {
Expand All @@ -83,7 +83,7 @@ describe('Maybe', () => {

const noneValue = Maybe.None.toOptional();
expectTypeOf(noneValue).toEqualTypeOf<undefined>();
expect(noneValue).toBe(undefined);
expect(noneValue).toBeUndefined();
});

it('#assertSome', () => {
Expand Down Expand Up @@ -115,6 +115,6 @@ describe('Maybe', () => {
}).toNullable();

expectTypeOf(notAll).toEqualTypeOf<{ 42: number; none: never } | null>();
expect(notAll).toBe(null);
expect(notAll).toBeNull();
});
});
2 changes: 1 addition & 1 deletion src/result.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,6 @@ describe('Result', () => {
.toNullable();

expectTypeOf(notAll).toEqualTypeOf<{ 42: number; none: never } | null>();
expect(notAll).toBe(null);
expect(notAll).toBeNull();
});
});

0 comments on commit f6cc577

Please sign in to comment.