mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-03 06:10:20 +00:00
Use manual compiling of mocha so that sourcemaps can be used
This commit is contained in:
parent
dbd660b78f
commit
44efe76a47
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@
|
|||||||
# ignore compiled lib files
|
# ignore compiled lib files
|
||||||
lib/*
|
lib/*
|
||||||
app/lib/*
|
app/lib/*
|
||||||
|
built-tests
|
||||||
|
|
||||||
# commit a placeholder to keep the app/lib directory
|
# commit a placeholder to keep the app/lib directory
|
||||||
!app/lib/.placeholder
|
!app/lib/.placeholder
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
# ignore src files
|
# ignore src files
|
||||||
src
|
src
|
||||||
|
|
||||||
|
# ignore tests
|
||||||
|
built-tests
|
||||||
|
test-resources
|
||||||
|
|
||||||
# ignore screenshots
|
# ignore screenshots
|
||||||
screenshots
|
screenshots
|
||||||
|
|
||||||
|
@ -83,9 +83,18 @@ gulp.task('lint', () => {
|
|||||||
.pipe(eslint.failAfterError());
|
.pipe(eslint.failAfterError());
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('test', ['build'], () => {
|
gulp.task('build-tests', done => {
|
||||||
return gulp.src('test/**/*js', {read: false})
|
return gulp.src(PATHS.TEST_SRC_JS)
|
||||||
.pipe(mocha({compilers: 'js:babel-register'}));
|
.pipe(sourcemaps.init())
|
||||||
|
.pipe(babel())
|
||||||
|
.on('error', done)
|
||||||
|
.pipe(sourcemaps.write('.'))
|
||||||
|
.pipe(gulp.dest(PATHS.TEST_DEST));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('test', ['build', 'build-tests'], () => {
|
||||||
|
return gulp.src(PATHS.TEST_DEST_JS, {read: false})
|
||||||
|
.pipe(mocha());
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('ci', callback => {
|
gulp.task('ci', callback => {
|
||||||
@ -98,7 +107,9 @@ function setUpPaths() {
|
|||||||
APP_SRC: 'app/src',
|
APP_SRC: 'app/src',
|
||||||
APP_DEST: 'app/lib',
|
APP_DEST: 'app/lib',
|
||||||
CLI_SRC: 'src',
|
CLI_SRC: 'src',
|
||||||
CLI_DEST: 'lib'
|
CLI_DEST: 'lib',
|
||||||
|
TEST_SRC: 'test',
|
||||||
|
TEST_DEST: 'built-tests'
|
||||||
};
|
};
|
||||||
|
|
||||||
paths.APP_MAIN_JS = path.join(paths.APP_SRC, '/main.js');
|
paths.APP_MAIN_JS = path.join(paths.APP_SRC, '/main.js');
|
||||||
@ -107,6 +118,8 @@ function setUpPaths() {
|
|||||||
paths.APP_STATIC_JS = path.join(paths.APP_SRC, 'static') + '/**/*.js';
|
paths.APP_STATIC_JS = path.join(paths.APP_SRC, 'static') + '/**/*.js';
|
||||||
paths.APP_STATIC_DEST = path.join(paths.APP_DEST, 'static');
|
paths.APP_STATIC_DEST = path.join(paths.APP_DEST, 'static');
|
||||||
paths.CLI_SRC_JS = paths.CLI_SRC + '/**/*.js';
|
paths.CLI_SRC_JS = paths.CLI_SRC + '/**/*.js';
|
||||||
|
paths.TEST_SRC_JS = paths.TEST_SRC + '/**/*.js';
|
||||||
|
paths.TEST_DEST_JS = paths.TEST_DEST + '/**/*.js';
|
||||||
|
|
||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user