ソースを参照

Fix Module Vanilla Tests

sebastien 6 年 前
コミット
8a099bf0a5

+ 6 - 3
Tools/Gulp/tasks/gulpTasks-tests.js

@@ -237,6 +237,7 @@ gulp.task("tests-modules", function() {
         sequencePromise = sequencePromise.then(() => {
             console.log("Running " + test.name);
             let basePath = relativeRootDir + 'tests/modules/' + test.name + '/';
+            
             rmDir(relativeRootDir + "tests/modules/build/");
             let compilePromise = Promise.resolve();
 
@@ -255,9 +256,11 @@ gulp.task("tests-modules", function() {
                 if (test.typescript && !test.bundler) {
                     compilePromise = compilePromise.then(() => {
                         return new Promise(function(resolve, reject) {
-                            var tsProject = typescript.createProject(basePath + (test.tsconfig || 'tsconfig.json'));
+                            var gulpRelativeRootDir = "../../";
+                            var gulpBasePath = gulpRelativeRootDir + 'tests/modules/' + test.name + '/';
+                            var tsProject = typescript.createProject(gulpBasePath + (test.tsconfig || 'tsconfig.json'));
 
-                            var tsResult = gulp.src(basePath + '/src/**/*.ts', { base: basePath })
+                            var tsResult = gulp.src(gulpBasePath + '/src/**/*.ts', { base: gulpBasePath })
                                 .pipe(tsProject());
 
                             let error = false;
@@ -265,7 +268,7 @@ gulp.task("tests-modules", function() {
                                 error = true;
                             });
 
-                            let jsPipe = tsResult.js.pipe(gulp.dest(relativeRootDir + "tests/modules/"));
+                            let jsPipe = tsResult.js.pipe(gulp.dest(gulpRelativeRootDir + "tests/modules/"));
 
                             jsPipe.once("finish", function() {
                                 if (error)

+ 8 - 2
tests/modules/tests-karma.js

@@ -4,11 +4,17 @@ function runTests(testType, BABYLON, GUI, INSPECTOR) {
 
     console.log("running tests");
 
-    describe(testType + ' module tests', function () {
+    describe(testType + ' tests', function () {
 
-        it("should have the dependencies loaded", function () {
+        it("should have BABYLON loaded", function () {
             assert.isDefined(BABYLON);
+        })
+
+        it("should have GUI loaded", function () {
             assert.isDefined(GUI);
+        })
+
+        it("should have BABYLON.GLTF2 loaded", function () {
             assert.isDefined(BABYLON.GLTF2);
         })
 

+ 0 - 4
tests/modules/tests-loader.js

@@ -1,4 +0,0 @@
-/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
-/// <reference path="../../../../dist/preview release/gui/babylon.gui.d.ts"/>
-// an error in typescript prevents us from using types instead of path
-runTests("typescript-vanilla", BABYLON, BABYLON.GUI);

+ 3 - 3
tests/modules/tests.json

@@ -10,9 +10,9 @@
             "typescript": true,
             "tsconfig": "tsconfig.json",
             "dependencies": [
-                "babylon.js",
-                "gui/babylon.gui.min.js",
-                "loaders/babylonjs.loaders.min.js"
+                "babylon.max.js",
+                "gui/babylon.gui.js",
+                "loaders/babylonjs.loaders.js"
             ]
         }
     ]

+ 0 - 1
tests/modules/typescript-vanilla/src/tests-loader.ts

@@ -2,7 +2,6 @@
 /// <reference path="../../../../dist/preview release/gui/babylon.gui.d.ts"/>
 // an error in typescript prevents us from using types instead of path
 
-
 declare function runTests(name: string, babylon: any, gui: any);
 
 runTests("typescript-vanilla", BABYLON, BABYLON.GUI);

+ 1 - 2
tests/modules/typescript-webpack/index.ts

@@ -5,7 +5,6 @@ import "babylonjs-loaders";
 import "babylonjs-serializers";
 // an error in typescript prevents us from using types instead of path
 
-
 declare function runTests(name: string, babylon: any, gui: any);
 
-runTests("typescript-vanilla", BABYLON, GUI);
+runTests("typescript-webpack", BABYLON, GUI);