diff --git a/Documentation/Contributors/TestingGuide/README.md b/Documentation/Contributors/TestingGuide/README.md
index f7eba3b3f905..b828a3f152c9 100644
--- a/Documentation/Contributors/TestingGuide/README.md
+++ b/Documentation/Contributors/TestingGuide/README.md
@@ -112,8 +112,6 @@ Alternatively, test suites can be run from the command line with the `includeNam
`npm run test -- --includeName Cartesian2`
-Similarly, test suites can be excluded with the `--excludeName` flag.
-
#### Using Browser Debugging Tools
If it is helpful to step through a unit test in a browser debugger, run the tests with the `debug` flag:
diff --git a/Specs/CesiumJasmineHtml.css b/Specs/CesiumJasmineHtml.css
deleted file mode 100644
index 92d2b7823c5e..000000000000
--- a/Specs/CesiumJasmineHtml.css
+++ /dev/null
@@ -1,14 +0,0 @@
-.jasmine_html-reporter .progress {
- position: relative;
- background: linear-gradient(to bottom, #67addf 0%, #ffffff 50%, #5c8727 100%);
- height: 20px;
- margin: 14px 0;
-}
-
-.jasmine_html-reporter .banner {
- margin: 14px 0;
-}
-
-.jasmine_html-reporter .results {
- display: block;
-}
diff --git a/Specs/Scene/CameraFlightPathSpec.js b/Specs/Scene/CameraFlightPathSpec.js
index 245fb76f4e18..b8fe63e14caa 100644
--- a/Specs/Scene/CameraFlightPathSpec.js
+++ b/Specs/Scene/CameraFlightPathSpec.js
@@ -1,8 +1,8 @@
import { Cartesian3 } from "../../Source/Cesium.js";
import { Cartographic } from "../../Source/Cesium.js";
import { Ellipsoid } from "../../Source/Cesium.js";
-import { GeographicProjection } from "../../../Source/Cesium.js";
-import { Globe } from "../../../Source/Cesium.js";
+import { GeographicProjection } from "../../Source/Cesium.js";
+import { Globe } from "../../Source/Cesium.js";
import { Math as CesiumMath } from "../../Source/Cesium.js";
import { OrthographicOffCenterFrustum } from "../../Source/Cesium.js";
import { CameraFlightPath } from "../../Source/Cesium.js";
diff --git a/Specs/Scene/IonImageryProviderSpec.js b/Specs/Scene/IonImageryProviderSpec.js
index 9c1beae6fc1d..ddb28545d64d 100644
--- a/Specs/Scene/IonImageryProviderSpec.js
+++ b/Specs/Scene/IonImageryProviderSpec.js
@@ -62,7 +62,7 @@ describe("Scene/IonImageryProvider", function () {
}).toThrowDeveloperError(ImageryProvider);
});
- it("readyPromise rejects with non-imagery asset", function (done) {
+ it("readyPromise rejects with non-imagery asset", function () {
const provider = createTestProvider({
type: "3DTILES",
url: "http://test.invalid/layer",
@@ -80,7 +80,7 @@ describe("Scene/IonImageryProvider", function () {
});
});
- it("readyPromise rejects with unknown external asset type", function (done) {
+ it("readyPromise rejects with unknown external asset type", function () {
const provider = createTestProvider({
type: "IMAGERY",
externalType: "TUBELCANE",
diff --git a/Specs/Scene/PntsParserSpec.js b/Specs/Scene/PntsParserSpec.js
index 08c0f6605a69..1de5e9db27d4 100644
--- a/Specs/Scene/PntsParserSpec.js
+++ b/Specs/Scene/PntsParserSpec.js
@@ -1,5 +1,4 @@
-import { PntsParser } from "../../Source/Cesium.js";
-import { RuntimeError } from "../Source/Cesium.js";
+import { PntsParser, RuntimeError } from "../../Source/Cesium.js";
import Cesium3DTilesTester from "../Cesium3DTilesTester.js";
describe("Scene/PntsParser", function () {
diff --git a/Specs/SpecRunner.html b/Specs/SpecRunner.html
new file mode 100644
index 000000000000..4be2ecff7eb8
--- /dev/null
+++ b/Specs/SpecRunner.html
@@ -0,0 +1,35 @@
+
+
+
+
+ Jasmine Spec Runner v4.0.1
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Specs/addDefaultMatchers.js b/Specs/addDefaultMatchers.js
index 262bee6c0941..e3a7dc0de76f 100644
--- a/Specs/addDefaultMatchers.js
+++ b/Specs/addDefaultMatchers.js
@@ -43,7 +43,7 @@ function makeThrowFunction(debug, Type, name) {
}
if (exception) {
- result = exception instanceof Type;
+ result = exception instanceof Type || exception.name === name;
}
let message;
diff --git a/Specs/customizeJasmine.js b/Specs/customizeJasmine.js
index 4dad65b1cfec..21174cb487a8 100644
--- a/Specs/customizeJasmine.js
+++ b/Specs/customizeJasmine.js
@@ -5,8 +5,6 @@ function customizeJasmine(
env,
includedCategory,
excludedCategory,
- includedName,
- excludedName,
webglValidation,
webglStub,
release
@@ -18,104 +16,25 @@ function customizeJasmine(
const originalDescribe = window.describe;
- window.describe = function (name, suite, categories) {
+ window.describe = function (name, suite, category) {
// exclude this spec if we're filtering by category and it's not the selected category
// otherwise if we have an excluded category, exclude this test if the category of this spec matches
- if (includedCategory && categories !== includedCategory) {
- return;
- } else if (excludedCategory && categories === excludedCategory) {
- return;
+ if (
+ includedCategory &&
+ includedCategory !== "" &&
+ includedCategory !== "none" &&
+ category !== includedCategory
+ ) {
+ window.xdescribe(name, suite);
+ } else if (
+ excludedCategory &&
+ excludedCategory !== "" &&
+ category === excludedCategory
+ ) {
+ window.xdescribe(name, suite);
+ } else {
+ originalDescribe(name, suite);
}
-
- if (includedName && !name.includes(includedName)) {
- return;
- } else if (excludedName && name.includes(excludedName)) {
- return;
- }
-
- originalDescribe(name, suite, categories);
- };
-
- // Override beforeEach(), afterEach(), beforeAll(), afterAll(), and it() to automatically
- // call done() when a returned promise resolves.
- const originalIt = window.it;
-
- window.it = function (description, f, timeout, categories) {
- originalIt(
- description,
- function (done) {
- const result = f(done);
- Promise.resolve(result)
- .then(function () {
- done();
- })
- .catch(function (e) {
- done.fail(`promise rejected: ${e.toString()}`);
- });
- },
- timeout,
- categories
- );
- };
-
- const originalBeforeEach = window.beforeEach;
-
- window.beforeEach = function (f) {
- originalBeforeEach(function (done) {
- const result = f(done);
- Promise.resolve(result)
- .then(function () {
- done();
- })
- .catch(function (e) {
- done.fail(`promise rejected: ${e.toString()}`);
- });
- });
- };
-
- const originalAfterEach = window.afterEach;
-
- window.afterEach = function (f) {
- originalAfterEach(function (done) {
- const result = f(done);
- Promise.resolve(result)
- .then(function () {
- done();
- })
- .catch(function (e) {
- done.fail(`promise rejected: ${e.toString()}`);
- });
- });
- };
-
- const originalBeforeAll = window.beforeAll;
-
- window.beforeAll = function (f) {
- originalBeforeAll(function (done) {
- const result = f(done);
- Promise.resolve(result)
- .then(function () {
- done();
- })
- .catch(function (e) {
- done.fail(`promise rejected: ${e.toString()}`);
- });
- });
- };
-
- const originalAfterAll = window.afterAll;
-
- window.afterAll = function (f) {
- originalAfterAll(function (done) {
- const result = f(done);
- Promise.resolve(result)
- .then(function () {
- done();
- })
- .catch(function (e) {
- done.fail(`promise rejected: ${e.toString()}`);
- });
- });
};
if (webglValidation) {
@@ -126,8 +45,6 @@ function customizeJasmine(
window.webglStub = true;
}
- //env.catchExceptions(true);
-
env.beforeEach(function () {
addDefaultMatchers(!release).call(env);
env.addCustomEqualityTester(equalsMethodEqualityTester);
diff --git a/Specs/karma-main.js b/Specs/karma-main.js
index c799049b8189..1bd0672e51f1 100644
--- a/Specs/karma-main.js
+++ b/Specs/karma-main.js
@@ -3,8 +3,6 @@ import customizeJasmine from "./customizeJasmine.js";
let includeCategory = "";
let excludeCategory = "";
-let includeName = "";
-let excludeName = "";
let webglValidation = false;
let webglStub = false;
let release = false;
@@ -12,8 +10,6 @@ let release = false;
if (__karma__.config.args) {
includeCategory = __karma__.config.args[0];
excludeCategory = __karma__.config.args[1];
- includeName = __karma__.config.args[2];
- excludeName = __karma__.config.args[3];
webglValidation = __karma__.config.args[4];
webglStub = __karma__.config.args[5];
release = __karma__.config.args[6];
@@ -30,8 +26,6 @@ customizeJasmine(
jasmine.getEnv(),
includeCategory,
excludeCategory,
- includeName,
- excludeName,
webglValidation,
webglStub,
release
diff --git a/Specs/karma.conf.cjs b/Specs/karma.conf.cjs
index aa79aab14dd4..442f35b6f821 100644
--- a/Specs/karma.conf.cjs
+++ b/Specs/karma.conf.cjs
@@ -46,7 +46,7 @@ module.exports = function (config) {
},
// list of files to exclude
- exclude: ["Specs/SpecList.js"],
+ exclude: ["Specs/SpecList.js", "Specs/SpecRunner.js", "Specs/spec-main.js"],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
diff --git a/Specs/spec-main.js b/Specs/spec-main.js
new file mode 100644
index 000000000000..4c85fcb17d96
--- /dev/null
+++ b/Specs/spec-main.js
@@ -0,0 +1,64 @@
+import customizeJasmine from "./customizeJasmine.js";
+import { defined, queryToObject } from "../Source/Cesium.js";
+
+const queryString = queryToObject(window.location.search.substring(1));
+
+let webglValidation = false;
+let webglStub = false;
+const built = window.location.search.indexOf("built") !== -1;
+const release = window.location.search.indexOf("release") !== -1;
+const categoryString = queryString.category;
+const excludeCategoryString = queryString.not;
+
+if (defined(queryString.webglValidation)) {
+ webglValidation = true;
+}
+
+if (defined(queryString.webglStub)) {
+ webglStub = true;
+}
+
+if (built) {
+ if (release) {
+ window.CESIUM_BASE_URL = "../Build/Cesium";
+ } else {
+ window.CESIUM_BASE_URL = "../Build/CesiumUnminified";
+ }
+} else {
+ window.CESIUM_BASE_URL = "../Source/";
+}
+
+jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
+
+const specFilter = new jasmine.HtmlSpecFilter({
+ filterString: function () {
+ return queryString.spec;
+ },
+});
+
+const env = jasmine.getEnv();
+env.configure({
+ stopSpecOnExpectationFailure: false,
+ stopOnSpecFailure: false,
+ random: false,
+ hideDisabled: true,
+ specFilter: function (spec) {
+ if (
+ !specFilter.matches(spec.getFullName()) ||
+ (categoryString === "none" && !defined(queryString.spec))
+ ) {
+ return false;
+ }
+
+ return true;
+ },
+});
+
+customizeJasmine(
+ env,
+ categoryString,
+ excludeCategoryString,
+ webglValidation,
+ webglStub,
+ release
+);
diff --git a/gulpfile.cjs b/gulpfile.cjs
index f7304a4ca58b..284dd23c1a36 100644
--- a/gulpfile.cjs
+++ b/gulpfile.cjs
@@ -126,6 +126,7 @@ const filesToConvertES6 = [
"!Source/Workers/transferTypedArrayTest.js",
"!Specs/karma-main.js",
"!Specs/karma.conf.cjs",
+ "!Specs/spec-main.js",
"!Specs/SpecList.js",
"!Specs/TestWorkers/**",
];
@@ -995,7 +996,6 @@ gulp.task("test", function (done) {
const suppressPassed = argv.suppressPassed ? argv.suppressPassed : false;
const debug = argv.debug ? false : true;
const includeName = argv.includeName ? argv.includeName : "";
- const excludeName = argv.excludeName ? argv.excludeName : "";
let browsers = ["Chrome"];
if (argv.browsers) {
@@ -1049,8 +1049,8 @@ gulp.task("test", function (done) {
args: [
includeCategory,
excludeCategory,
+ "--grep",
includeName,
- excludeName,
webglValidation,
webglStub,
release,
diff --git a/index.html b/index.html
index d5a44d41cee3..efbe3662dfd4 100644
--- a/index.html
+++ b/index.html
@@ -53,6 +53,51 @@
+
+ Tests
+
+
Documentation