An open API service indexing awesome lists of open source software.

https://github.com/flow-build/test-core

Core library with testing functionalities for flowbuild
https://github.com/flow-build/test-core

Last synced: 8 months ago
JSON representation

Core library with testing functionalities for flowbuild

Awesome Lists containing this project

README

          

# test-core
Core library with testing functionalities for flowbuild

![npm version](https://img.shields.io/npm/v/@flowbuild/test-core) ![language](https://img.shields.io/github/languages/top/flow-build/test-core) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=flow-build_test-core&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=flow-build_test-core) [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)

## Installation
```
npm install @flowbuild/test-core
```

## Usage (getAllPaths)
You can use this plugin to get the paths ignoring or not the present loops, as
follows.

```js
// ignoring loops - add 'true' as the second argument of function 'getAllPaths'
const { getAllPaths } = require('@flowbuild/test-core');
const allPaths = getAllPaths(blueprint, true);

// counting paths with loops - just pass the first argument (false is the default
// for the second argument)
const { getAllPaths } = require('@flowbuild/test-core');
const allPaths = getAllPaths(blueprint);

/*
note that 'blueprint' must be a valid blueprint inside flowbuild's pattern, i.e,
must have the valid properties 'name', 'description' and 'blueprint_spec' in it.
*/
```

## Usage (getLoops)
You can use this plugin to get all loops present in a blueprint.

```js
const { getLoops } = require('@flowbuild/test-core');
const allLoops = getLoops(blueprint);

/*
note that 'blueprint' must be a valid blueprint inside flowbuild's pattern, i.e,
must have the valid properties 'name', 'description' and 'blueprint_spec' in it.
*/
```

## Tested Blueprints Patterns (Diagrams Images)

### Number of paths: 1 | Number of loops: 0
Very Simple BP

### Number of paths: 2 | Number of loops: 0
Simple BP

### Number of paths: 4 | Number of loops: 0
Medium BP

### Number of paths: 8 (Counting loop); 4 (Ignoring loop) | Number of loops: 1
Loop Simple BP

### Number of paths: 8 (Counting loop); 6 (Ignoring loop) | Number of loops: 1
Loop Medium BP

### Number of paths: 9 (Counting loop); 5 (Ignoring loop) | Number of loops: 1
Average BP

### Number of paths: 60 (Counting loop); 5 (Ignoring loop) | Number of loops: 11
Loop Multiple BP