@rabid/pmi-dummy
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

pmi-dummy

A library to handle the execution of dummy operations for testing purposes. Implements the Integration interface from @rabid/pipeline-manager.

Installation

npm install pmi-dummy

Usage

Importing the Library

import { Dummy } from 'pmi-dummy';
import { Logger } from '@rabid/pipeline-manager';

Creating an Instance

Create an instance of Dummy.

const dummy = new Dummy();

Executing the Dummy Operation

Execute the dummy operation by calling the execute method with the input object containing the parameters for the operation.

const input = {
  waitFor: 2000,
  forceError: false,
};

const logger = new Logger();

dummy.execute(input, null, logger).then(result => {
  console.log(result);
}).catch(error => {
  console.error(error);
});

Example

Here is a complete example demonstrating how to use the Dummy class:

import { Dummy } from 'pmi-dummy';
import { Logger } from '@rabid/pipeline-manager';

const dummy = new Dummy();

const input = {
  waitFor: 2000,
  forceError: false,
};

const logger = new Logger();

dummy.execute(input, null, logger).then(result => {
  console.log(result);
}).catch(error => {
  console.error(error);
});

Readme

Keywords

none

Package Sidebar

Install

npm i @rabid/pmi-dummy

Weekly Downloads

16

Version

2.0.0

License

Affero GPL-3.0

Unpacked Size

5.17 kB

Total Files

5

Last publish

Collaborators

  • jmdiego