Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests for utils #537

Merged
merged 14 commits into from
Mar 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore(util): move plugin storage error message to config
narekhovhannisyan committed Mar 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b75b648a63a2b222bbd4b4def362fd2fe4924fff
6 changes: 3 additions & 3 deletions src/util/plugin-storage.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {ERRORS} from '../util/errors';
import {STRINGS} from '../config';

import {PluginInterface} from '../types/interface';
import {PluginStorage} from '../types/plugin-storage';

const {PluginInitalizationError} = ERRORS;
const {NOT_INITALIZED_PLUGIN} = STRINGS;

/**
* Storage for maintaining plugins.
@@ -19,9 +21,7 @@ export const pluginStorage = () => {
const plugin = storage[name];

if (!plugin) {
throw new PluginInitalizationError(
`Not initalized plugin: ${name}. Check if ${name} is in 'manifest.initalize.plugins'.`
);
throw new PluginInitalizationError(NOT_INITALIZED_PLUGIN(name));
}

return plugin;