@flowbuild/test-core

1.2.0 • Public • Published

test-core

Core library with testing functionalities for flowbuild

npm version language semantic-release: angular

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.

// 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.

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

Package Sidebar

Install

npm i @flowbuild/test-core

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

417 kB

Total Files

30

Last publish

Collaborators

  • imagure
  • lucas.biason.fdte
  • wallace.silva.ferreira
  • ricardo.imagure
  • pedropereiraassis
  • fdte_pcasari
  • gustavo_fdte
  • rafgoncalves
  • elson_oliveira
  • bot.flowbuild