You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Documentation/Contributors/TestingGuide/README.md
+16-12
Original file line number
Diff line number
Diff line change
@@ -192,7 +192,7 @@ It is also possible for Karma to run all tests against each browser installed on
192
192
193
193
#### Run a Single Test or Suite
194
194
195
-
Sometimes it is useful to run a single test or suite for easier debugging purposes. To do this simply change the `it` function call for the desired test to `fit`, the `f` stands for `focused` in Jasmine speak. Likewise, to run an entire suite, use `fdefineSuite` instead of `defineSuite`.
195
+
Sometimes it is useful to run a single test or suite for easier debugging purposes. To do this simply change the `it` function call for the desired test to `fit`, the `f` stands for `focused` in Jasmine speak. Likewise, to run an entire suite, use `fdescribe` instead of `describe`.
196
196
197
197
## Testing Previous Versions of CesiumJS
198
198
@@ -233,22 +233,24 @@ Tests are written in JavaScript using Jasmine. It is important to realize that
233
233
Here is a stripped down version of the tests:
234
234
235
235
```javascript
236
-
defineSuite([
236
+
define([
237
237
'Core/Cartesian3'
238
238
], function(
239
239
Cartesian3) {
240
240
'use strict';
241
241
242
-
it('construct with default values', function() {
243
-
var cartesian =newCartesian3();
244
-
expect(cartesian.x).toEqual(0.0);
245
-
expect(cartesian.y).toEqual(0.0);
246
-
expect(cartesian.z).toEqual(0.0);
242
+
describe('Cartesian3', function(){
243
+
it('construct with default values', function() {
244
+
var cartesian =newCartesian3();
245
+
expect(cartesian.x).toEqual(0.0);
246
+
expect(cartesian.y).toEqual(0.0);
247
+
expect(cartesian.z).toEqual(0.0);
248
+
});
247
249
});
248
250
});
249
251
```
250
252
251
-
`defineSuite` identifies this file as a test suite and include modules the same way `define` is used in engine code. The modules are listed in alphabetical order as usual _except_ that the module being tested is listed first.
253
+
`describe` identifies this file as a test suite and we include modules the same way `define` is used in engine code.
252
254
253
255
Using Jasmine, each test is defined by calling `it` and passing a string that describes the test and a function that is the test.
254
256
@@ -692,17 +694,18 @@ This test is more cohesive and easier to debug than if it were written using a _
692
694
693
695
### Categories
694
696
695
-
As mentioned above, some tests are in the `'WebGL'` category. To assign a category to a suite, pass the category to `defineSuite`.
697
+
As mentioned above, some tests are in the `'WebGL'` category. To assign a category to a suite, pass the category to `describe`.
`defineSuite` is a custom CesiumJS function that wraps Jasmine define calls and provides the category capability.
725
+
CesiumJS uses a customized `describe` function that wraps Jasmine describe calls and provides the category capability.
722
726
723
727
## Manual Testing
724
728
@@ -756,7 +760,7 @@ You can run or debug the tests by using the first two buttons. The third button
756
760
757
761

758
762
759
-
This runner has lots of options, such as only showing failing tests or automatically re-running the tests on a test interval (great for development when combined with `fdefineSuite`!). You can hover over each of the buttons to see what they do.
763
+
This runner has lots of options, such as only showing failing tests or automatically re-running the tests on a test interval (great for development when combined with `fdescribe`!). You can hover over each of the buttons to see what they do.
760
764
761
765
To make jumping between the source and spec files easier download the [Cesium WebStorm plugin](https://github.com/AnalyticalGraphicsInc/cesium-webstorm-plugin).
0 commit comments