nikku/karma-browserify

[framework.browserify]: Error: ENOTDIR: not a directory, stat

Closed this issue · 1 comments

I'm trying to setup a karma/ jasmine ttd into my project and get the above subject error

the following is my package.json

....
  "devDependencies": {
    "babelify": "^6.1.3",
    "browser-sync": "^2.8.0",
    "browserify": "^11.0.0",
    "del": "^1.2.0",
    "exorcist": "^0.4.0",
    "gulp": "^3.9.0",
    "gulp-buffer": "0.0.2",
    "gulp-if": "^1.2.5",
    "gulp-karma": "*",
    "gulp-uglify": "^1.2.0",
    "gulp-util": "^3.0.6",
    "jasmine": "*",
    "karma": "*",
    "karma-browserify": "^5.0.3",
    "karma-chrome-launcher": "^0.2.3",
    "karma-jasmine": "*",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.7.0",
    "yargs": "^3.16.1"
  },
  "dependencies": {
    "phaser": "^2.4.1"
  },
  "browserify": {
    "transform": [
      "babelify"
    ]
  }
}

My karma.conf.js

module.exports = function(config) {
  config.set({
    basePath: "./",
    browsers: ['Chrome'],
    frameworks: ['browserify','jasmine'],
    files: [
      'src/**/*.js',
      'tests/**/*.spec.js'
    ],
    port: 3000,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    singleRun: true,
    failOnEmptyTestSuite: false,
    preprocessors: {
      'src/**/*.js': ['browserify'],
      'tests/**/*.js': ['browserify']
    },
    browserify: {
        debug: true,
        transform: [ 'babelify' ]
    }
  });
};

The logs

05 04 2016 21:16:38.567:ERROR [framework.browserify]: bundle error 05 04 2016 21:16:38.568:ERROR [framework.browserify]: Error: ENOTDIR: not a directory, stat '/Applications/Atom.app/Contents/Resources/app.asar/exports/states/GameStateInit'

The directory is wrong and doesn't lead to the project's directory.

I'm new to karma so I'm not sure what to look for. What does the error message suggest?

nikku commented

A few observations:

  • The error message suggests that you are developing an application via Atom and that this somehow messes up the path(s). Make sure basedir is set to the actual project directory.
  • Set failOnEmptyTestSuite to true for immediate feedback if your paths are wrong or not.
  • Do not include the source files (they are going to be pulled in via requires in the tests automatically.