summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-05-08 15:28:53 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-05-08 15:28:53 +0000
commite98f12aff9d86f62852d03bef0f5011f6e3c848e (patch)
treeda8be58c2756bb2ae0c13fef9afafa8ec06e6f6f /doc
parent11ff9fc6a9837cd5defa0325b5057a5a3d84634c (diff)
parent06455d2fc13ecab2d03904d6427e3e1e55328e02 (diff)
downloadgitlab-ce-e98f12aff9d86f62852d03bef0f5011f6e3c848e.tar.gz
Merge branch '28794-standardize-jasmine-test-describe-block-names-that-test-specific-methods' into 'master'
Resolve "Standardize jasmine test describe block names that test specific methods" Closes #28794 See merge request !11137
Diffstat (limited to 'doc')
-rw-r--r--doc/development/fe_guide/testing.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/development/fe_guide/testing.md b/doc/development/fe_guide/testing.md
index 157c13352ca..a8c264bbd3c 100644
--- a/doc/development/fe_guide/testing.md
+++ b/doc/development/fe_guide/testing.md
@@ -29,6 +29,33 @@ browser and you will not have access to certain APIs, such as
which will have to be stubbed.
### Writing tests
+
+When writing describe test blocks to test specific functions/methods,
+please use the method name as the describe block name.
+
+```javascript
+// Good
+describe('methodName', () => {
+ it('passes', () => {
+ expect(true).toEqual(true);
+ });
+});
+
+// Bad
+describe('#methodName', () => {
+ it('passes', () => {
+ expect(true).toEqual(true);
+ });
+});
+
+// Bad
+describe('.methodName', () => {
+ it('passes', () => {
+ expect(true).toEqual(true);
+ });
+});
+```
+
### Vue.js unit tests
See this [section][vue-test].