Interface-based instructions
A set of tools for working with code on interfaces-based.
It is best to use together with tx-reflector.
npm i --save-dev ibi
Features
- Create mocks by interface
- "Code generation" on interfaces-based
- Creating Regression Tests
Create mocks by interface
See tx-reflector configuration
npm i --save-dev ibi tx-reflector
;; ; mock; // {name: "", type: "", checked: false};mock; // {name: "", type: "", checked: true};
Code Generation
; // Where// - <T> — Interface of the result-object// - args — Array of variable names, the first is a reference to the result-object, the second source-object
An example of creating a function for generating DOM-properties based on the input props
.
; // Source interface // Result interface // Create a factory of declarations; // Register the conversion function for `IInputProps`; // Somewhere in the code, for example React-like component;
Regressions
Laziness to write an example, so look tests
// ...
Development
npm i
npm test
, code coverage