directory - How to go back 1 folder level wih __dirname? -


i using gulp-karma , facing simple problem cannot seems find doing wrong .

gulp.task('test', function (done) {     karma.start({         configfile: __dirname + '..\\test\\' +'\karma.conf.js',         singlerun: true     }, done); }); 

here code using , cannot seems go 1 level in folder directory . when above append ..\ folder direcotry without going 1 level (which usual use of ..\). following folder structure .

parent|       test|karma.conf.js       webapirole|gulpfile.js 

and folder inside webapirole folder . want go 1 folder , go inisde test folder contains karma.conf.js file. can make me understand doing wrong here ?

error getting

[18:06:32] starting 'tdd'... error [config]: file c:\users\documents\webapirole..\test\karma.conf.js not exist 

__dirname string. can use ../ traverse folder structure , path.join resolve path

path = require('path')  configfile: path.join(__dirname, '../test/karma.conf.js'), 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -