# @flowbuild/test-core

> Core library with testing functionalities for flowbuild

Latest version **1.2.0** (published 2022-11-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @flowbuild/test-core
pnpm add @flowbuild/test-core
yarn add @flowbuild/test-core
bun add @flowbuild/test-core
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-11-04 |
| First published | 2022-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 407.2 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pedro Assis |
| Maintainers | ricardo.imagure, pedropereiraassis, fdte_pcasari, gustavo_fdte, rafgoncalves, elson_oliveira, bot.flowbuild, matheus.zanetti |
| Keywords | tests, paths, processes, blueprints |

## Links

- npm: https://www.npmjs.com/package/@flowbuild/test-core
- Repository: https://github.com/flow-build/test-core
- Homepage: https://github.com/flow-build/test-core#readme
- Issues: https://github.com/flow-build/test-core/issues
- npm.io page: https://npm.io/package/@flowbuild/test-core

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) 4.17.21
- [cytoscape](https://npm.io/package/cytoscape.md) 3.22.1
- [cytoscape-all-paths](https://npm.io/package/cytoscape-all-paths.md) 0.1.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads
- [tg-resolve](https://npm.io/package/tg-resolve.md) — 176 weekly downloads

## Recent versions

- 1.2.0 (latest) — 2022-11-04
- 1.1.1 — 2022-10-31
- 1.1.0 — 2022-09-23
- 1.0.0 — 2022-09-10

## 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)
[![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
<img src='./public/images/verySimpleBP.png' alt='Very Simple BP'/>

### Number of paths: 2 | Number of loops: 0
<img src='./public/images/simpleBP.png' alt='Simple BP'/>

### Number of paths: 4 | Number of loops: 0
<img src='./public/images/mediumBP.png' alt='Medium BP'/>

### Number of paths: 8 (Counting loop); 4 (Ignoring loop) | Number of loops: 1
<img src='./public/images/loopSimpleBP.png' alt='Loop Simple BP'/>

### Number of paths: 8 (Counting loop); 6 (Ignoring loop) | Number of loops: 1
<img src='./public/images/loopMediumBP.png' alt='Loop Medium BP'/>

### Number of paths: 9 (Counting loop); 5 (Ignoring loop) | Number of loops: 1
<img src='./public/images/averageBP.png' alt='Average BP'/>

### Number of paths: 60 (Counting loop); 5 (Ignoring loop) | Number of loops: 11
<img src='./public/images/loopMultipleBP.png' alt='Loop Multiple BP'/>

---
_Source: https://npm.io/package/@flowbuild/test-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
