summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-10-31 22:33:34 +0000
committerFatih Acet <acetfatih@gmail.com>2016-10-31 22:33:34 +0000
commit75d15be9b2a83ed53b752b9860dc4f0c2f1aba8d (patch)
treedf7f73a61cc2a5b08ae3705cfdadb4ae28773fec
parent68dadc98ae94f9c20bd5f80c8eeb78d46cc45d53 (diff)
parentf285f4790ff4a2188fbac75fc4a70b7f31c740bb (diff)
downloadgitlab-ce-75d15be9b2a83ed53b752b9860dc4f0c2f1aba8d.tar.gz
Merge branch 'patch-8' into 'master'
Add ES array methods as cause of Phantom.js errors. ## What does this MR do? Adds another example of something that causes a common error in JavaScript testing to the frontend dev docs. See merge request !7102
-rw-r--r--doc/development/frontend.md11
1 files changed, 8 insertions, 3 deletions
diff --git a/doc/development/frontend.md b/doc/development/frontend.md
index 4fb56444917..ece8f880542 100644
--- a/doc/development/frontend.md
+++ b/doc/development/frontend.md
@@ -238,13 +238,18 @@ For our currently-supported browsers, see our [requirements][requirements].
[scss-style-guide]: scss_styleguide.md
[requirements]: ../install/requirements.md#supported-web-browsers
-## Common Errors
+## Gotchas
-### Rspec (Capybara/Poltergeist) chokes on general JavaScript errors
+### Phantom.JS (used by Teaspoon & Rspec) chokes, returning vague JavaScript errors
If you see very generic JavaScript errors (e.g. `jQuery is undefined`) being thrown in tests, but
can't reproduce them manually, you may have included `ES6`-style JavaScript in files that don't
have the `.js.es6` file extension. Either use ES5-friendly JavaScript or rename the file you're
-working in (`git mv <file>.js> <file.js.es6>`).
+working in (`git mv <file.js> <file.js.es6>`).
+
+Similar errors will be thrown if you're using
+any of the [array methods introduced in ES6](http://www.2ality.com/2014/05/es6-array-methods.html)
+whether or not you've updated the file extension.
+