0.0.1 • Published 3 years ago
unittestsbuilder-test v0.0.1
Create and execute unit tests within minutes
Unit Tests builder
is a testing toolkit developed using Facebook's Jest framework for the developers and testers to seamlessly write unit tests for every scenarios.
Installation
npm i unit-tests-builder --save
Steps
- Create a excel file
- Add the unit tests data
- Feed it inside your code
- Run the code
Excel Columns
Test Case Name | Data | Expected Data | Validation | Function | Path |
---|
- Test Case Name - Name of the Test Case
- Data - Data that has to be provided to the function (Given Data)
- Expected Data - Data that is expected after successful completion of test case or the data that is to be passed to the validations.
- Validation - Jest validation expect functions.
- Function - Name of the function (without parentheses) that is to be executed for a specific test case.
- Path - Relative path of the file where the function is declared.
Note: (1) All the above colums are mandatory with the same name (2) To use multiple validations in one unit test use '/' as a delimeter.
eg: toBe/toEqual
(3) If you're not specifying the parameters in jest validation functions, it will take Expected Data as a parameter. e.g: If theExpected Data
is"Login Success"
andValidation
istoBe
, thentoBe
function will take"Login Success"
as a parameter. Similarly, if you can also pass the parameters inside the validation functioneg: toBeGreaterThan(20)
Configuration
const testApp = require('unit-tests-builder');
const test = testApp("<--Excel Path-->", "<-- Test Suite Name -->")
0.0.1
3 years ago