A library to handle the execution of dummy operations for testing purposes. Implements the Integration
interface from @rabid/pipeline-manager
.
npm install pmi-dummy
import { Dummy } from 'pmi-dummy';
import { Logger } from '@rabid/pipeline-manager';
Create an instance of Dummy
.
const dummy = new Dummy();
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);
});
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);
});