-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove context mocks from tests, model errors domain
Signed-off-by: rare-magma <rare-magma@posteo.eu>
- Loading branch information
1 parent
9f71e6f
commit d1ba1de
Showing
20 changed files
with
228 additions
and
297 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { CsvError } from "./csvError"; | ||
|
||
// biome-ignore lint/complexity/noStaticOnlyClass: <explanation> | ||
export class CsvErrorMother { | ||
static error(): CsvError { | ||
return { | ||
errors: [ | ||
{ | ||
type: "FieldMismatch", | ||
code: "TooFewFields", | ||
message: "Line 0: Too few fields: expected 3 fields but parsed 2", | ||
row: 0, | ||
}, | ||
], | ||
file: "123.csv", | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { ParseError } from "papaparse"; | ||
|
||
export class CsvError { | ||
errors: ParseError[]; | ||
file: string; | ||
|
||
constructor(errors: ParseError[], file: string) { | ||
this.errors = errors; | ||
this.file = file; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { JsonError } from "./jsonError"; | ||
|
||
// biome-ignore lint/complexity/noStaticOnlyClass: <explanation> | ||
export class JsonErrorMother { | ||
static error(): JsonError { | ||
return { | ||
errors: | ||
"SyntaxError: Expected ',' or '}' after property value in JSON at position 209", | ||
file: "123.json", | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export class JsonError { | ||
errors: string; | ||
file: string; | ||
|
||
constructor(errors: string, file: string) { | ||
this.errors = errors; | ||
this.file = file; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.