-
-
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.
feature(genericReuse): add types with generic to mock factory
BREAKING CHANGE: extensions (Provider) provideMethod will be deprecated in future releases in favour of provideMethodWithDeferredValue Provider.provideMethod is deprecated changed: Before: Provider.instance.provideMethod((name: string, value: any) => { ... }); After: Provider.instance.provideMethodWithDeferredValue((name: string, value: () => any) => { ... }); Read the DOCS for more information * add global scope and move type reference cache in the scope * remove space * init scope * add first version - extend generic still doesnt work * remove unused method * add back the new generic tests * remove unused file, disable extensions, intersection and ts lib (WIP) * simplify generic function * merge generic tests and add reuse test * remove unused files * re enable working tests and add some info for this branch * add test and comment to find test to fix * add enumerable to object so it will have the correct output and add support to recursive call signatures * fix type generic case * restric interface to specific types so it will be easier to extend it * rename function * first working version generic extends * remove unused descriptor and add more test to support types * add more tests * make sure factory cache is not exposed, divide caches * refactor type parameter * add more test and refactor the mess in mock factory call * add more tests * add more tests * added back promises implementation and all test * remove comment we will write test scenario when available * add direct type test mock * remove unused import * remove comments * remove unused field * document playground command * Update README.md * remove unnecessary code, rename text and simplify for * remove unnecessary create mock in the test * remove unnecessary if * deprecate getMethod and add new method to make sure with don't introduce breaking changes * update deprecated comment * update
- Loading branch information
Showing
75 changed files
with
1,501 additions
and
561 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const karmaBaseConfig = require('./karma.config.base'); | ||
|
||
module.exports = function(config) { | ||
const karmaConfig = karmaBaseConfig(config, "../../test/framework/contextDeprecated.ts"); | ||
|
||
config.set(karmaConfig); | ||
}; |
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,7 @@ | ||
const karmaBaseConfig = require('./karma.config.base'); | ||
|
||
module.exports = function(config) { | ||
const karmaConfig = karmaBaseConfig(config, '../../test/transformer/playground.test.ts'); | ||
|
||
config.set(karmaConfig); | ||
}; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// tslint:disable:no-any | ||
export function functionMethod(name: string, value: any): any { | ||
export function functionMethod(name: string, value: () => any): any { | ||
return (): any => { | ||
return value; | ||
return value(); | ||
}; | ||
} |
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.