Skip to content

Commit

Permalink
Tiny cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer committed Apr 11, 2017
1 parent 40d993e commit 0c87839
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/jest-runtime/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ const NODE_MODULES = path.sep + 'node_modules' + path.sep;
const SNAPSHOT_EXTENSION = 'snap';

const getModuleNameMapper = (config: Config) => {
if (Array.isArray(config.moduleNameMapper)) {
if (
Array.isArray(config.moduleNameMapper) && config.moduleNameMapper.length
) {
return config.moduleNameMapper.map(([regex, moduleName]) => {
return {moduleName, regex: new RegExp(regex)};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function parse(file: string) {
itBlocks.push(position);
} else {
let element = node.expression;
let expectText: string = '';
let expectText = '';
while (!expectText) {
expectText = element.text;
element = element.expression;
Expand Down

0 comments on commit 0c87839

Please sign in to comment.