title: angular-cli Path must be a string. Received undefined
body: <p>I updated <code>angular-cli</code> version and the current version I have right now is <code>1.0.0-beta.32.3 [1.0.0-beta.26]</code>. However, on running the <code>test</code> script i.e. <code>npm run test</code> it throws the following error:</p>
  
  <p><code>Path must be a string. Received undefined</code></p>
  
  <p>Found a similar issue opened a few days ago here: <a href="https://github.com/angular/angular-cli/issues/4815" rel="nofollow noreferrer">https://github.com/angular/angular-cli/issues/4815</a> </p>
  
  <p>Seems like a webpack issue to me but I can't really say. I hope this helps everyone running into the same issue. </p>
  
  <p><strong>Update:</strong></p>
  
  <pre><code>Path must be a string. Received undefined
  TypeError: Path must be a string. Received undefined
      at assertPath (path.js:7:11)
      at Object.resolve (path.js:1146:7)
      at getWebpackTestConfig (/usr/lib/node_modules/angular-cli/models/webpack-build-test.js:131:25)
      at init (/usr/lib/node_modules/angular-cli/plugins/karma.js:45:25)
      at Array.invoke (/home/umair/workspace/ng-portal/node_modules/di/lib/injector.js:75:15)
      at Injector.get (/home/umair/workspace/ng-portal/node_modules/di/lib/injector.js:48:43)
      at /home/umair/workspace/ng-portal/node_modules/karma/lib/server.js:143:20
      at Array.forEach (native)
      at Server._start (/home/umair/workspace/ng-portal/node_modules/karma/lib/server.js:142:21)
      at Injector.invoke (/home/umair/workspace/ng-portal/node_modules/di/lib/injector.js:75:15)
      at Server.start (/home/umair/workspace/ng-portal/node_modules/karma/lib/server.js:103:18)
      at Promise (/home/umair/workspace/ng-portal/node_modules/@angular/cli/tasks/test.js:34:25)
      at Class.run (/home/umair/workspace/ng-portal/node_modules/@angular/cli/tasks/test.js:15:16)
      at Class.run (/home/umair/workspace/ng-portal/node_modules/@angular/cli/commands/test.js:38:25)
      at Class.&lt;anonymous&gt; (/home/umair/workspace/ng-portal/node_modules/@angular/cli/ember-cli/lib/models/command.js:134:17)
      at process._tickCallback (internal/process/next_tick.js:103:7)
  </code></pre>
  
  <p><strong>angular-cli.json</strong></p>
  
  <pre><code>{
    "project": {
      "version": "1.0.0-beta.26",
      "name": "ng-portal"
    },
    "apps": [
      {
        "root": "src",
        "outDir": "dist",
        "assets": [
          "assets",
          "favicon.ico"
        ],
        "index": "index.html",
        "main": "main.ts",
        "test": "test.ts",
        "tsconfig": "tsconfig.json",
        "prefix": "app",
        "mobile": false,
        "styles": [
          "styles.css",
          "../node_modules/bootstrap/dist/css/bootstrap.min.css",
           "../node_modules/font-awesome/css/font-awesome.css"
        ],
        "scripts": [],
        "environmentSource": "environments/environment.ts",
        "environments": {
  
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
        }
      }
    ],
    "addons": [
      "../node_modules/font-awesome/fonts/*.+(otf|eot|svg|ttf|woff|woff2)"
  ],
    "e2e": {
      "protractor": {
        "config": "./protractor.conf.js"
      }
    },
    "test": {
      "karma": {
        "config": "./karma.conf.js"
      }
    },
    "defaults": {
      "styleExt": "css",
      "prefixInterfaces": false,
      "inline": {
        "style": false,
        "template": false
      },
      "spec": {
        "class": false,
        "component": true,
        "directive": true,
        "module": false,
        "pipe": true,
        "service": true
      }
    }
  }
  </code></pre>