Skip to content

Commit

Permalink
test(lib): init my custom plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
narekhovhannisyan committed Mar 10, 2024
1 parent eaf6213 commit 6b773e6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/__tests__/unit/lib/my-custom-plugin.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {MyCustomPlugin} from '../../../lib/my-custom-plugin';

describe('lib/my-custom-plugin: ', () => {
describe('MyCustomPlugin(): ', () => {
it('has metadata field.', () => {
const pluginInstance = MyCustomPlugin({});

expect(pluginInstance).toHaveProperty('metadata');
expect(pluginInstance).toHaveProperty('execute');
expect(pluginInstance.metadata).toHaveProperty('kind');
expect(typeof pluginInstance.execute).toBe('function');
});

describe('execute(): ', () => {
it('applies logic on provided inputs array.', async () => {
const pluginInstance = MyCustomPlugin({});
const inputs = [{}];

const response = await pluginInstance.execute(inputs, {});
expect(response).toEqual(inputs);
});
});
});
});

0 comments on commit 6b773e6

Please sign in to comment.