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

Error trying to use config in Node 6 #81

Closed
michaeljota opened this issue Aug 10, 2016 · 0 comments
Closed

Error trying to use config in Node 6 #81

michaeljota opened this issue Aug 10, 2016 · 0 comments

Comments

@michaeljota
Copy link

michaeljota commented Aug 10, 2016

Hi!

I got this error, seems to be relate to Node 6 release.

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.join (path.js:466:7)
    at ~~~\node_modules\jasmine\lib\jasmine.js:93:38
    at Array.forEach (native)
    at Jasmine.loadConfig (~~~\node_modules\jasmine\lib\jasmine.js:92:20)
    at module.exports (~~~\node_modules\gulp-jasmine\index.js:36:11)
    at Gulp.gulp.task (~~~\gulpfile.js:26:7)
    at module.exports (~~~\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (~~~\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (~~~\node_modules\orchestrator\index.js:214:10)

Here is my gulpfile.js

const gulp = require('gulp');
const jasmine = require('gulp-jasmine');

const paths = {
  scripts: ['./server/**/*.js'],
  specs: ['./server/**/*[Ss]pec.js']
}

var jasmineConfig = {
  "spec_files": [
    "**/*[sS]pec.js"
  ],
  "helpers": [
    "spec/helpers/**/*.js"
  ],
  "stopSpecOnExpectationFailure": false,
  "random": false
}



gulp.task('test', () => {
  gulp
    .src(paths.specs)
    .pipe(
      jasmine({
        config: jasmineConfig
      })
    );
});

gulp.task('default', [
  'test',
  'watch'
]);

gulp.task('watch', () => {
  gulp.watch(paths.scripts, ['test']);
});

I try already with

var jasmineConfig = require('./spec/support/jasmine.json');

Or even inline with no declare variable, but it doesn't work, however the configuration gets loaded, it show that error. If no configuration gets loaded, it shows nothing.

EDIT: I fixed. I was missing the "spec_dir" for the configuration. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant