All values values identified as 'CONSTANT_VALUES' can be moved to a lib called seed data.
This lib cannot depend on any internal lib as it should only contain defaults.
If the constant value is used in multiple libraries it should be moved to this lib.
Values that should not be located here are those who are only used as test data, and those can be placed in test-data.
Optional:
Seed data has no internal dependencies. If a type is required it should be type-cased externally when it is used.
If a value will require being used with typecasting a comment can be made with the value.
[ ] Modify default data where it is used not in its where it is declared.
The data named as a const but that requires being modified to be used in different environments should be modified at its final destination.
If necessary we can have a helper that takes a constant value and modifies it after being given an argument.
The const should be moved to seed-data and a helper should be implemented in the test that modifies it there.
[ ] Types from external libs should be used directly and not imported from an internal lib
[ ] Internal types should be consumed from the source and exported by user-flow-cli-testing
[ ] Test Helper Type need to be generic and not import from cli
I am aware of the fact that this makes things a lot less readable, however if the cli testing utils is going to be used inside of cli it cannot import anything from cli.
However, the benefit is that simply by insuring that it does not require the importing from the cli itself it will make the tool useful for any other projects consuming the cli helper
[ ] Rename user-flow-cli-testing to cli-tester
As this will now become a generic tool it can be renamed to reflect the fact.
Assertions
[ ] seed-data does not depend on any internal lib
[ ] test-data does not depend on external lib
[ ] cli-tester does not depend on any internal lib
[ ] cli depends on test-data, seed-data and cli-tester
[ ] sandbox depends on cli, test-data, seed-data and cli-tester
Removing Cyclical Dependencies In User-Flow
Current State:
There are to sources of cyclical dependencies in user-flow both of which are related to testing
Cyclical Dependencies between the cli and user-flow-cli-testing
What is user-flow-cli-testing?
It is a testing utils lib that is used to facilitate the testing of certain parts of the cli.
Usage
This library seems to be imported in 3 other libraries
cli
sandbox
test-data
Concat and sorted list of imports
'Test Helper Classes'
'Test Helper Functions'
'Test Helper Type'
'Internal Type'
'External Lib Type'
'Dynamic Values'
'CONSTANT_VALUES'
Suggested solution
All values values identified as 'CONSTANT_VALUES' can be moved to a lib called seed data. This lib cannot depend on any internal lib as it should only contain defaults. If the constant value is used in multiple libraries it should be moved to this lib. Values that should not be located here are those who are only used as test data, and those can be placed in test-data. Optional: Seed data has no internal dependencies. If a type is required it should be type-cased externally when it is used. If a value will require being used with typecasting a comment can be made with the value.
The data named as a const but that requires being modified to be used in different environments should be modified at its final destination. If necessary we can have a helper that takes a constant value and modifies it after being given an argument. The const should be moved to seed-data and a helper should be implemented in the test that modifies it there.
[ ] Types from external libs should be used directly and not imported from an internal lib
[ ] Internal types should be consumed from the source and exported by user-flow-cli-testing
[ ] Test Helper Type need to be generic and not import from cli
I am aware of the fact that this makes things a lot less readable, however if the cli testing utils is going to be used inside of cli it cannot import anything from cli. However, the benefit is that simply by insuring that it does not require the importing from the cli itself it will make the tool useful for any other projects consuming the cli helper
As this will now become a generic tool it can be renamed to reflect the fact.
Assertions