1.0.17 • Published 3 years ago

unittestsbuilder v1.0.17

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Build Status

Create and execute unit tests within minutes


Unit Tests builder is a testing toolkit developed on the top of Facebook's Jest framework for the developers and testers to seamlessly write unit tests for every scenarios.

Installation


npm i unittestsbuilder --save

Configuration


const testApp = require('unittestsbuilder');
const test = new testApp({<--config-->})

Set-up your config


PropertyDescriptionDefault ValueType
file_pathExcel File PathUnitTest.xlsxstring
jest_flagsJest CLI Flags[]array of string
suite_nameName of the test suiteUnit Test Suitestring
html_reportTest case execution report in HTML formatfalseboolean
excel_reportTest case execution report in Excel formatfalseboolean
text_reportTest case execution report in Text formatfalseboolean

Steps


  • Create an excel file.
  • Add the unit tests. (each row will be considered as a single test)
  • Configure excel path.
  • Run the code.

Excel Columns


Test Case NameDataExpected DataValidationFunctionPath
  • 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. (For more: https://jestjs.io/docs/expect)
  • 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 the Expected Data is "Login Success" and Validation is toBe, then toBe function will take "Login Success" as a parameter. Similarly, if you can also pass the parameters inside the validation function eg: toBeGreaterThan(20)

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago