-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(transformer): extract repeated error in a constant, fixed error …
…wording
- Loading branch information
Showing
4 changed files
with
11 additions
and
12 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { NoTransformerError } from './errors/no-transformer.error'; | ||
import { DeepPartial } from './partial/deepPartial'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
export function createMockList<T extends object>(quantity: number, iterator?: (index: number) => DeepPartial<T>): T[] { | ||
throw new Error(` | ||
ts-auto-mock is not been configured as a transformer. Please follow the instructions in https://typescript-tdd.github.io/ts-auto-mock/installation | ||
If help is required you can find us on https://typescript-tdd.github.io | ||
`); | ||
throw new Error(NoTransformerError); | ||
} |
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { NoTransformerError } from './errors/no-transformer.error'; | ||
import { DeepPartial } from './partial/deepPartial'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
export function createMock<T extends object>(values?: DeepPartial<T>): T { | ||
throw new Error(` | ||
ts-auto-mock is not been configured as a transformer. Please follow the instructions in https://typescript-tdd.github.io/ts-auto-mock/installation | ||
If help is required you can find us on https://typescript-tdd.github.io | ||
`); | ||
throw new Error(NoTransformerError); | ||
} |
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,4 @@ | ||
export const NoTransformerError: string = ` | ||
hey, it looks like ts-auto-mock is not configured correctly! You can find the instructions here https://typescript-tdd.github.io/ts-auto-mock/installation. | ||
If you need further assistance feel free to drop a message on slack. (link at the bottom of https://typescript-tdd.github.io/ts-auto-mock) | ||
`; |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import { NoTransformerError } from './errors/no-transformer.error'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
export function registerMock<T extends object>(factory: () => T): void { | ||
throw new Error(` | ||
ts-auto-mock is not been configured as a transformer. Please follow the instructions in https://typescript-tdd.github.io/ts-auto-mock/installation | ||
If help is required you can find us on https://typescript-tdd.github.io | ||
`); | ||
throw new Error(NoTransformerError); | ||
} |