@kaspersky/dev-tools
Version:
Development tools and configs for Babel, ESLint and TypeScript
25 lines (24 loc) • 999 B
JavaScript
;
const { getApplicationsConfig } = require('./applications/config');
const { parseCliConfig } = require('./helpers/command-line-parser');
const { getPluginsConfig } = require('./plugins/config');
const testConfigurationProductEnum = {
app: getApplicationsConfig,
plugin: getPluginsConfig
};
/**
* Function that finds and exports requested configuration for jest tests
* @param { Any } param0 container to provide params
* @param { String } param0.product product is value, which describes which configuration should be returned.
* E.g. app will return applications configuration, which applies to NWC, Cloud Console, etc. And plugin value will
* return only configurations, which apply to NWC plugins. Allowed values: ['app', 'plugin']
*/
function jest({ product }) {
if (!product)
throw Error('Please, provide product argument!');
const { type } = parseCliConfig();
return testConfigurationProductEnum[product](type);
}
module.exports = {
jest
};