Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
brienne
Developer Documentation
Commits
f1b82d09
Commit
f1b82d09
authored
7 years ago
by
totten
Browse files
Options
Downloads
Patches
Plain Diff
testing/karma.md - Don't imply that Karma===Javascript
parent
59dd5b76
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/testing/karma.md
+13
-10
13 additions, 10 deletions
docs/testing/karma.md
with
13 additions
and
10 deletions
docs/testing/karma.md
+
13
−
10
View file @
f1b82d09
...
...
@@ -3,23 +3,26 @@
The test suites require a small amount of [setup](/testing/index.md#setup). If your system was created via [buildkit](/tools/buildkit.md) and
[civibuild](/tools/civibuild.md), then it was handled automatically.
Javascript test
s ensure that CiviCRM's JS logic is working as expected –
for example, ensuring that a custom JS widget adapts correctly to different input
s.
[Karma] is a
Javascript test
ing tool which executes [Jasmine] tests on the command-line.
It was introduced in Civi v4.6 in tandem with several AngularJS-based UI
s.
Buildkit
includes the tools required for running the tests
. Alternatively,
download
Karma and Jasmine
by running
"
npm install
"
in the civicrm directory.
[
Buildkit
](
/tools/buildkit.md
)
includes a copy of
`karma`
. Alternatively,
you can
download
it
by running
`
npm install
`
in the
`
civicrm
`
directory.
These test were introduced in Civi v4.6 and are written in the AngularJS
conventions using [karma] and [jasmine].
## Running Karma
## Running Javascript Tests
If you're actively working on Javascript files or Karma tests, then you can
start
`karma`
in a
*watch*
mode. Any time you save a change to disk, it
will automatically re-execute the tests.
```
bash
$
cd
/path/to/civicrm
$
npm
tes
t
$
karma star
t
```
## Running Karma (Other ways)
You can also run the karma tests as they would be run by
[
Jenkins
](
/testing/continuous-integration.md
)
using
[
civi-test-run
](
/tools/civi-test-run.md
)
.
[
k
arma
]:
https://karma-runner.github.io/1.0/index.html
[
j
asmine
]:
https://jasmine.github.io/2.1/introduction.html
[
K
arma
]:
https://karma-runner.github.io/1.0/index.html
[
J
asmine
]:
https://jasmine.github.io/2.1/introduction.html
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment