Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
49c4059a
Commit
49c4059a
authored
Feb 06, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace teaspoon references with Karma
parent
4a925837
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
22 deletions
+15
-22
doc/development/frontend.md
doc/development/frontend.md
+6
-12
doc/development/rake_tasks.md
doc/development/rake_tasks.md
+5
-5
doc/development/testing.md
doc/development/testing.md
+3
-4
spec/javascripts/behaviors/quick_submit_spec.js
spec/javascripts/behaviors/quick_submit_spec.js
+1
-1
No files found.
doc/development/frontend.md
View file @
49c4059a
...
@@ -250,23 +250,17 @@ information.
...
@@ -250,23 +250,17 @@ information.
### Running frontend tests
### Running frontend tests
`rake
teaspoon
`
runs the frontend-only (JavaScript) tests.
`rake
karma
`
runs the frontend-only (JavaScript) tests.
It consists of two subtasks:
It consists of two subtasks:
-
`rake
teaspoon
:fixtures`
(re-)generates fixtures
-
`rake
karma
:fixtures`
(re-)generates fixtures
-
`rake
teaspoon
:tests`
actually executes the tests
-
`rake
karma
:tests`
actually executes the tests
As long as the fixtures don't change,
`rake
teaspoon
:tests`
is sufficient
As long as the fixtures don't change,
`rake
karma
:tests`
is sufficient
(and saves you some time).
(and saves you some time).
If you need to debug your tests and/or application code while they're
running, navigate to
[
localhost:3000/teaspoon
](
http://localhost:3000/teaspoon
)
in your browser, open DevTools, and run tests for individual files by clicking
on them. This is also much faster than setting up and running tests from the
command line.
Please note: Not all of the frontend fixtures are generated. Some are still static
Please note: Not all of the frontend fixtures are generated. Some are still static
files. These will not be touched by
`rake
teaspoon
:fixtures`
.
files. These will not be touched by
`rake
karma
:fixtures`
.
## Design Patterns
## Design Patterns
...
@@ -370,7 +364,7 @@ For our currently-supported browsers, see our [requirements][requirements].
...
@@ -370,7 +364,7 @@ For our currently-supported browsers, see our [requirements][requirements].
### Spec errors due to use of ES6 features in `.js` files
### Spec errors due to use of ES6 features in `.js` files
If you see very generic JavaScript errors (e.g.
`jQuery is undefined`
) being
If you see very generic JavaScript errors (e.g.
`jQuery is undefined`
) being
thrown in
Teaspoon
, Spinach, or Rspec tests but can't reproduce them manually,
thrown in
Karma
, Spinach, or Rspec tests but can't reproduce them manually,
you may have included
`ES6`
-style JavaScript in files that don't have the
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
`.js.es6`
file extension. Either use ES5-friendly JavaScript or rename the file
you're working in (
`git mv <file.js> <file.js.es6>`
).
you're working in (
`git mv <file.js> <file.js.es6>`
).
...
...
doc/development/rake_tasks.md
View file @
49c4059a
...
@@ -17,14 +17,14 @@ Note: `db:setup` calls `db:seed` but this does nothing.
...
@@ -17,14 +17,14 @@ Note: `db:setup` calls `db:seed` but this does nothing.
In order to run the test you can use the following commands:
In order to run the test you can use the following commands:
-
`rake spinach`
to run the spinach suite
-
`rake spinach`
to run the spinach suite
-
`rake spec`
to run the rspec suite
-
`rake spec`
to run the rspec suite
-
`rake
teaspoon`
to run the teaspoon
test suite
-
`rake
karma`
to run the karma
test suite
-
`rake gitlab:test`
to run all the tests
-
`rake gitlab:test`
to run all the tests
Note: Both
`rake spinach`
and
`rake spec`
takes significant time to pass.
Note: Both
`rake spinach`
and
`rake spec`
takes significant time to pass.
Instead of running full test suite locally you can save a lot of time by running
Instead of running full test suite locally you can save a lot of time by running
a single test or directory related to your changes. After you submit merge request
a single test or directory related to your changes. After you submit merge request
CI will run full test suite for you. Green CI status in the merge request means
CI will run full test suite for you. Green CI status in the merge request means
full test suite is passed.
full test suite is passed.
Note: You can't run
`rspec .`
since this will try to run all the
`_spec.rb`
Note: You can't run
`rspec .`
since this will try to run all the
`_spec.rb`
files it can find, also the ones in
`/tmp`
files it can find, also the ones in
`/tmp`
...
...
doc/development/testing.md
View file @
49c4059a
...
@@ -31,9 +31,8 @@ GitLab uses [factory_girl] as a test fixture replacement.
...
@@ -31,9 +31,8 @@ GitLab uses [factory_girl] as a test fixture replacement.
## JavaScript
## JavaScript
GitLab uses [Teaspoon] to run its [Jasmine] JavaScript specs. They can be run on
GitLab uses [Karma] to run its [Jasmine] JavaScript specs. They can be run on
the command line via
`bundle exec teaspoon`
, or via a web browser at
the command line via
`bundle exec karma`
.
`http://localhost:3000/teaspoon`
when the Rails server is running.
-
JavaScript tests live in
`spec/javascripts/`
, matching the folder structure of
-
JavaScript tests live in
`spec/javascripts/`
, matching the folder structure of
`app/assets/javascripts/`
:
`app/assets/javascripts/behaviors/autosize.js.es6`
has a corresponding
`app/assets/javascripts/`
:
`app/assets/javascripts/behaviors/autosize.js.es6`
has a corresponding
...
@@ -51,7 +50,7 @@ the command line via `bundle exec teaspoon`, or via a web browser at
...
@@ -51,7 +50,7 @@ the command line via `bundle exec teaspoon`, or via a web browser at
[
`Notification`
](
https://developer.mozilla.org/en-US/docs/Web/API/notification
)
,
[
`Notification`
](
https://developer.mozilla.org/en-US/docs/Web/API/notification
)
,
which will have to be stubbed.
which will have to be stubbed.
[
Teaspoon
]:
https://github.com/modeset/teaspoon
[
Karma
]:
https://github.com/karma-runner/karma
[
Jasmine
]:
https://github.com/jasmine/jasmine
[
Jasmine
]:
https://github.com/jasmine/jasmine
## RSpec
## RSpec
...
...
spec/javascripts/behaviors/quick_submit_spec.js
View file @
49c4059a
...
@@ -40,7 +40,7 @@ require('~/behaviors/quick_submit');
...
@@ -40,7 +40,7 @@ require('~/behaviors/quick_submit');
expect
(
$
(
'
input[type=submit]
'
)).
toBeDisabled
();
expect
(
$
(
'
input[type=submit]
'
)).
toBeDisabled
();
return
expect
(
$
(
'
button[type=submit]
'
)).
toBeDisabled
();
return
expect
(
$
(
'
button[type=submit]
'
)).
toBeDisabled
();
});
});
// We cannot stub `navigator.userAgent` for CI's `rake
teaspoon
` task, so we'll
// We cannot stub `navigator.userAgent` for CI's `rake
karma
` task, so we'll
// only run the tests that apply to the current platform
// only run the tests that apply to the current platform
if
(
navigator
.
userAgent
.
match
(
/Macintosh/
))
{
if
(
navigator
.
userAgent
.
match
(
/Macintosh/
))
{
it
(
'
responds to Meta+Enter
'
,
function
()
{
it
(
'
responds to Meta+Enter
'
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment