All files / dir index.ts

100% Statements 6/6
83.33% Branches 5/6
100% Functions 1/1
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16              2x 1x   1x 1x     1x  
/**
 * User directory path Redux reducer
 * @param  {string} dir default user directory path
 * @returns string user directory path
 */
export default function dirReducer(
  dir: string
): string {
  if (!atom) {
    throw new Error('No project directory found. Atom may not be initialized.');
  }E
  if (atom && atom.project.rootDirectories.length > 0) {
    return atom.project.rootDirectories[0].path;
  }
}