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

Adding identity object property; fixing preprocessor bug #367

Merged
merged 1 commit into from
Jan 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions packages/kyt-core/cli/actions/__tests__/lintScript.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jest.mock('shelljs', () => (
stdout: '',
code: 0,
}),
config: {
silent: false,
},
}
));

Expand Down
1 change: 1 addition & 0 deletions packages/kyt-core/cli/actions/lintScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = (config, flags) => {
logger.info(`Using ESLint file: ${configFile}`);

const lint = () => {
shell.config.silent = false;
const eslintLib = require.resolve('eslint');
const eslint = eslintLib.replace(/(.*)(lib\/api\.js)/, '$1bin/eslint.js');

Expand Down
4 changes: 2 additions & 2 deletions packages/kyt-core/config/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module.exports = (rootDir, aliases = {}) => ({
{
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
resolveFromUtils('file.stub'),
'\\.(css|scss)$':
resolveFromUtils('style.stub'),
'^[./a-zA-Z0-9!&$_-]+\\.(css|scss)$':
'identity-obj-proxy',
// when this is removed from the base webpack config, we can likely
// remove the runtime and include the polyfill in the test environment
'babel-runtime': require.resolve('babel-plugin-transform-runtime'),
Expand Down
7 changes: 6 additions & 1 deletion packages/kyt-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"filesize": "3.3.0",
"glob": "7.1.0",
"gzip-size": "3.0.0",
"identity-obj-proxy": "3.0.0",
"inquirer": "1.2.1",
"install": "0.8.1",
"jest": "16.0.1",
Expand All @@ -58,5 +59,9 @@
"webpack-merge": "0.14.1",
"webpack-node-externals": "1.5.4"
},
"keywords": ["kyt", "core", "kyt-core"]
"keywords": [
"kyt",
"core",
"kyt-core"
]
}
3 changes: 2 additions & 1 deletion packages/kyt-core/utils/jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const resolve = require('resolve');
const normalizeDep = (prefix, dep) => {
let resolved;
try {
if (dep.indexOf('babel') !== 0) {
// Prefix babel when babel doesn't exist
if (dep.indexOf('babel') < 0) {
resolved = resolve.sync(`${prefix}-${dep}`, { basedir: userRootPath });
}
return resolved || resolve.sync(dep, { basedir: userRootPath });
Expand Down