Browse Source

Merge pull request #9773 from sguillia/ponicode

Add configuration files for Ponicode tests
Raanan Weber 4 years ago
parent
commit
0a8c4c7345

+ 4 - 2
.vscode/settings.json

@@ -58,5 +58,7 @@
     },
     "editor.tabSize": 4,
     "typescript.tsdk": "node_modules\\typescript\\lib",
-    "typescript.preferences.importModuleSpecifier": "relative"
-}
+    "typescript.preferences.importModuleSpecifier": "relative",
+    "ponicode.testSettings.testLocation.locationType": "Custom",
+    "ponicode.testSettings.testLocation.path": "{rootDir}/tests/ponicode/babylon/{filePathWithoutSrc}/{fileName}.test.{ext}"
+}

+ 12 - 0
babel.config.json

@@ -0,0 +1,12 @@
+{
+	"presets": [
+		[
+			"@babel/preset-env",
+			{
+				"exclude": [
+					"@babel/plugin-transform-regenerator"
+				]
+			}
+		]
+	]
+}

+ 6 - 2
package.json

@@ -36,6 +36,7 @@
     "readme": "Babylon.js is a 3D engine based on webgl and javascript",
     "readmeFilename": "README.md",
     "devDependencies": {
+        "@babel/preset-env": "^7.12.11",
         "@fortawesome/fontawesome-svg-core": "~1.2.28",
         "@fortawesome/free-regular-svg-icons": "~5.13.0",
         "@fortawesome/free-solid-svg-icons": "~5.13.0",
@@ -72,6 +73,7 @@
         "gulp-tslint": "^8.1.4",
         "gulp-typedoc": "^2.2.5",
         "gulp-typescript": "4.0.2",
+        "jest": "^26.6.3",
         "karma": "^5.0.9",
         "karma-browserstack-launcher": "^1.6.0",
         "karma-chai": "^0.1.0",
@@ -101,6 +103,7 @@
         "symlink-dir": "^4.1.0",
         "through2": "~3.0.1",
         "ts-loader": "^7.0.5",
+        "ts-node": "^9.1.1",
         "tslib": ">=1.10.0",
         "tslint": "^6.1.2",
         "typedoc": "^0.17.7",
@@ -112,5 +115,6 @@
         "webpack-stream": "~5.2.1",
         "xhr2": "^0.2.0",
         "xmlbuilder": "15.1.1"
-    }
-}
+    },
+    "dependencies": {}
+}

+ 3 - 2
src/tsconfig.json

@@ -3,6 +3,7 @@
     "compilerOptions": {
         "types": [],
         "baseUrl": "./",
-        "rootDir": "./"
+        "rootDir": "./",
+        "outDir": "../.temp/manualBuildCore"
     }
-}
+}

+ 12 - 0
tests/ponicode/babel.config.json

@@ -0,0 +1,12 @@
+{
+	"presets": [
+		[
+			"@babel/preset-env",
+			{
+				"exclude": [
+					"@babel/plugin-transform-regenerator"
+				]
+			}
+		]
+	]
+}

+ 15 - 0
tests/ponicode/jest.config.ts

@@ -0,0 +1,15 @@
+import type { Config } from "@jest/types"
+import path from "path"
+
+const testDir = path.resolve(__dirname, "../../.temp/tests/ponicode")
+const sourceDir = path.resolve(__dirname, "../../.temp/manualBuildCore")
+
+const config: Config.InitialOptions = {
+	rootDir: testDir,
+	testMatch: ["**/*.test.js"],
+	moduleNameMapper: {
+		"babylonjs/(.*)": path.join(sourceDir, "$1"),
+	},
+}
+
+export = config

+ 26 - 0
tests/ponicode/tsconfig-compiler.json

@@ -0,0 +1,26 @@
+{
+	"compilerOptions": {
+		"target": "ES5",
+		"module": "commonjs",
+		"declaration": true,
+		"sourceMap": true,
+		"outDir": "../../.temp/tests/ponicode",
+		"rootDir": "babylon",
+		"strict": true,
+		"esModuleInterop": true,
+		"baseUrl": "../../",
+		"paths": {
+			"babylonjs/*": [
+				".temp/manualBuildCore/*"
+			]
+		},
+		"types": [
+			"node",
+			"jest"
+		]
+	},
+	"include": [
+		"babylon"
+	],
+	"exclude": []
+}

+ 26 - 0
tests/ponicode/tsconfig.json

@@ -0,0 +1,26 @@
+{
+	"compilerOptions": {
+		"target": "ES5",
+		"module": "commonjs",
+		"declaration": true,
+		"sourceMap": true,
+		"outDir": "../../.temp/tests/ponicode",
+		"rootDir": "babylon",
+		"strict": true,
+		"esModuleInterop": true,
+		"baseUrl": "../../",
+		"paths": {
+			"babylonjs/*": [
+				"./src/*"
+			]
+		},
+		"types": [
+			"node",
+			"jest"
+		]
+	},
+	"include": [
+		"babylon"
+	],
+	"exclude": []
+}