Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'transformIgnorePatterns',
'reporters',
];
if (overrides) {
supportedKeys.forEach((key) => {
// eslint-disable-next-line
if (overrides.hasOwnProperty(key)) {
config[key] = overrides[key];
delete overrides[key];
}
});
const unsupportedKeys = Object.keys(overrides);
if (unsupportedKeys.length) {
/* eslint-disable */
console.error(
color.red(
'Out of the box, kkt-ssr only supports overriding ' +
'these Jest options:\n\n' +
supportedKeys.map(key => color.bold(' \u2022 ' + key)).join('\n') +
'.\n\n' +
'These options in your package.json Jest configuration ' +
'are not currently supported by kkt-ssr:\n\n' +
unsupportedKeys.map(key => color.bold(' \u2022 ' + key)).join('\n')
)
);
/* eslint-enable */
process.exit(1);
}
}
return config;
};
'transformIgnorePatterns',
'reporters',
];
if (overrides) {
supportedKeys.forEach((key) => {
// eslint-disable-next-line
if (overrides.hasOwnProperty(key)) {
config[key] = overrides[key];
delete overrides[key];
}
});
const unsupportedKeys = Object.keys(overrides);
if (unsupportedKeys.length) {
/* eslint-disable */
console.error(
color.red(
'Out of the box, kkt only supports overriding ' +
'these Jest options:\n\n' +
supportedKeys.map(key => color.bold(' \u2022 ' + key)).join('\n') +
'.\n\n' +
'These options in your package.json Jest configuration ' +
'are not currently supported by kkt:\n\n' +
unsupportedKeys.map(key => color.bold(' \u2022 ' + key)).join('\n')
)
);
/* eslint-enable */
process.exit(1);
}
}
return config;
};
#!/usr/bin/env node
const path = require('path');
const prepareUrls = require('local-ip-url/prepareUrls');
const detect = require('detect-port');
const color = require('colors-cli/safe');
const express = require('express');
const apiMocker = require('../');
if (!process.argv.slice(2).length) {
console.log(color.red('Error: Need to pass parameters!'));
console.log(`E.g: ${color.yellow('mocker ')}\n`);
return;
}
let mockpath = process.argv[2];
mockpath = require.resolve(path.resolve(mockpath));
(async () => {
const HOST = process.env.HOST || '0.0.0.0';
let DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3721;
const PORT = await detect(DEFAULT_PORT);
if (DEFAULT_PORT !== PORT) {
DEFAULT_PORT = PORT;
}
process.env.PORT = DEFAULT_PORT;