-
-
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(hydrate-mocks): add create-hydrated-mock functionality
* refactor(hydrate-mocks): remove duplicated code * refactor(hydrate-mocks): revert changes * feat(hydrate-mocks): red - add create-hydrated-mock type and transformation * feat(hydrate-mocks): green - add support for basic createHydratedMock * feat(hydrate-mocks): green - add support for union types * feat(hydrate-mocks): green - make sure undefined union types will result in undefined * feat(hydrate-mocks): green - refactor tests * feat(hydrate-mocks): green - remove unnecessary check * feat(hydrate-mocks): refactor - rename test file * feat(hydrate-mocks): refactor - rename test description * feat(hydrate-mocks): red - make sure createHydratedMock doesn't is independent from createMock * feat(hydrate-mocks): red - remove unnecessary check in the test * feat(hydrate-mocks): green - always returns a new mock when is hydrated * feat(hydrate-mocks): red - add test when creatingMock with createMock after a mock has been created with createHydratedMock * feat(hydrate-mocks): green - duplicate all the cache (declaration, factory and file registration) to support hydrated mocks * feat(hydrate-mocks): refactor - extract modulesNameIdentifierPerFile * feat(hydrate-mocks): green - add hydrated initial generic support * feat(hydrate-mocks): red - add hydrated tests for generic with extends * feat(hydrate-mocks): green - use the correct mock for generic extensions * feat(hydrate-mocks): green - run createHydratedMock on ci * feat(hydrate-mocks): green - add support for circular generic extensions * feat(hydrate-mocks): green - add support for register mock * feat(hydrate-mocks): green - add test for type of enum * feat(hydrate-mocks): green - add test to make sure createMock and createHydratedMocks are independent * feat(hydrate-mocks): green - add support for intersections * feat(hydrate-mocks): refactor - create a function to handle type of declaration based on scope * feat(hydrate-mocks): refactor - create clone static method on Scope so it will be easier to carry hydrated when creating a new scope * feat(hydrate-mocks): refactor - remove duplicated code in register mock * feat(hydrate-mocks): doc - add createHydratedMock documentation
- Loading branch information
Showing
20 changed files
with
667 additions
and
137 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
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 @@ | ||
import { NoTransformerError } from './errors/no-transformer.error'; | ||
|
||
import { PartialDeep } from './partial/partial'; | ||
|
||
export function createHydratedMock<T extends object>( | ||
_values?: PartialDeep<T> | ||
): T { | ||
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,3 +1,4 @@ | ||
export { createMock } from './create-mock'; | ||
export { createMockList } from './create-mock-list'; | ||
export { createHydratedMock } from './create-hydrated-mock'; | ||
export { registerMock } from './register-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
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
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.