Browse Source

add configuration files for Ponicode tests

bilow 4 years ago
parent
commit
4556de9a75

+ 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"
+				]
+			}
+		]
+	]
+}

+ 5 - 1
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",
@@ -43,6 +44,7 @@
         "@svgr/webpack": "^5.4.0",
         "@types/chai": "^4.2.11",
         "@types/dagre": "^0.7.44",
+        "@types/jest": "^26.0.19",
         "@types/mocha": "^7.0.2",
         "@types/node": "^14.0.11",
         "@types/react": "~16.9.35",
@@ -72,6 +74,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 +104,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",
@@ -113,4 +117,4 @@
         "xhr2": "^0.2.0",
         "xmlbuilder": "15.1.1"
     }
-}
+}

+ 3 - 1
src/tsconfig.json

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

+ 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

+ 31 - 0
tests/ponicode/tsconfig.json

@@ -0,0 +1,31 @@
+{
+	"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": [],
+	"references": [
+		{
+			"path": "../../src"
+		}
+	]
+}