NPM module - izara-testing: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 18: Line 18:
/**
/**
  * Get the configuration for one resource
  * Get the configuration for one resource
* @param {string} ServiceName - ServiceName for the resource
* @param {string} resourceType - Resource Type
  * @param {string} resourceName - Name of the resource
  * @param {string} resourceName - Name of the resource
  *
  *
  * @returns {object}
  * @returns {object}
  */
  */
module.exports.GetResourceConfig = (resourceName) => {
module.exports.GetResourceConfig = (ServiceName, resourceType, resourceName) => {
</syntaxhighlight>
</syntaxhighlight>


Line 30: Line 32:
/**
/**
  * Extract all matching unit test configurations
  * Extract all matching unit test configurations
  * @param {string} resourceName - Name of the resource being tested
* @param {string} ServiceName - ServiceName for the resource
  * @param {string} testNames - can be used to only extract unit tests from the specified test_tags
* @param {string} resourceType - Resource Type
  * @param {string} resourceName - Name of the resource
  * @param {string} testNames - can be used to only extract unit tests from the specified testTags
  *
  *
  * @returns {array} array of unit test configuration objects
  * @returns {array} array of unit test configuration objects
  */
  */
module.exports.GetUnitTestConfig = (resourceName, testTags = NULL) => {
module.exports.GetUnitTestConfig = (ServiceName, resourceType, resourceName, testTags = NULL) => {
</syntaxhighlight>
</syntaxhighlight>


[[Category:NPM modules| izara-testing]]
[[Category:NPM modules| izara-testing]]

Revision as of 04:26, 10 August 2020

Overview

Code shared by multiple repositories used for testing, can by npm installed using --save-dev setting, only used in local environments.

The module has the following components:

TestLog

Functions that handle log output from test scripts, including a LOG_LEVEL setting that can be affect which log results are outputted and thisLine which assists outputting debug information such as line number where the log was called from.

IntegrationTestConfig

Build unit tests from Integration Test Config service which must be cloned into the same root directory as the service being tested because config files are linked to using relative paths.

Function - GetResourceConfig

/**
 * Get the configuration for one resource
 * @param {string} ServiceName - ServiceName for the resource
 * @param {string} resourceType - Resource Type
 * @param {string} resourceName - Name of the resource
 *
 * @returns {object}
 */
module.exports.GetResourceConfig = (ServiceName, resourceType, resourceName) => {

Function - GetUnitTestConfig

/**
 * Extract all matching unit test configurations
 * @param {string} ServiceName - ServiceName for the resource
 * @param {string} resourceType - Resource Type
 * @param {string} resourceName - Name of the resource
 * @param {string} testNames - can be used to only extract unit tests from the specified testTags
 *
 * @returns {array} array of unit test configuration objects
 */
module.exports.GetUnitTestConfig = (ServiceName, resourceType, resourceName, testTags = NULL) => {