Browse Source

validation compilation uses the same config that builds the viewer

Raanan Weber 7 years ago
parent
commit
710b0a2340
1 changed files with 20 additions and 1 deletions
  1. 20 1
      Tools/Gulp/gulpfile.js

+ 20 - 1
Tools/Gulp/gulpfile.js

@@ -1076,7 +1076,7 @@ var rmDir = function (dirPath) {
  * Launches the viewer's KARMA validation tests in chrome in order to debug them.
  * Launches the viewer's KARMA validation tests in chrome in order to debug them.
  * (Can only be launch locally.)
  * (Can only be launch locally.)
  */
  */
-gulp.task("tests-viewer-validation-karma", ["tests-viewer-transpile"], function (done) {
+gulp.task("tests-viewer-validation-karma", ["tests-viewer-validation-transpile"], function (done) {
     var kamaServerOptions = {
     var kamaServerOptions = {
         configFile: __dirname + "/../../Viewer/tests/validation/karma.conf.js",
         configFile: __dirname + "/../../Viewer/tests/validation/karma.conf.js",
         singleRun: false
         singleRun: false
@@ -1089,6 +1089,25 @@ gulp.task("tests-viewer-validation-karma", ["tests-viewer-transpile"], function
 /**
 /**
  * Transpiles viewer typescript unit tests. 
  * Transpiles viewer typescript unit tests. 
  */
  */
+gulp.task("tests-viewer-validation-transpile", function (done) {
+
+    let wpBuild = webpack(require('../../Viewer//webpack.gulp.config.js'));
+
+    // clean the built directory
+    rmDir("../../Viewer/tests/build/");
+
+    return wpBuild
+        .pipe(rename(function (path) {
+            if (path.extname === '.js') {
+                path.basename = "test";
+            }
+        }))
+        .pipe(gulp.dest("../../Viewer/tests/build/"));
+});
+
+/**
+ * Transpiles viewer typescript unit tests. 
+ */
 gulp.task("tests-viewer-transpile", function (done) {
 gulp.task("tests-viewer-transpile", function (done) {
 
 
     let wpBuild = webpack(require('../../Viewer/tests/unit/webpack.config.js'));
     let wpBuild = webpack(require('../../Viewer/tests/unit/webpack.config.js'));