summaryrefslogtreecommitdiff
path: root/openstack_dashboard/karma.conf.js
diff options
context:
space:
mode:
authorShaoquan Chen <sean.chen2@hp.com>2015-06-20 22:35:49 -0700
committerRichard Jones <r1chardj0n3s@gmail.com>2015-06-23 11:07:30 +1000
commit595d9cf546be4beb83744bf5e8a4c6b0631212d4 (patch)
treeaffb832d51ab3387099670e1d711e5b7ba8de456 /openstack_dashboard/karma.conf.js
parentf00db6cedb77ff20337b8cbbc0a57cc08716c813 (diff)
downloadhorizon-595d9cf546be4beb83744bf5e8a4c6b0631212d4.tar.gz
Normalizing Karma configuration
This cleans up the karma configuration to use auto-discovery in place of explicitly listing files. Change-Id: I7b05f7d6921af3a577270638a02717d04e7b20cd Closes-Bug: #1467684
Diffstat (limited to 'openstack_dashboard/karma.conf.js')
-rw-r--r--openstack_dashboard/karma.conf.js48
1 files changed, 34 insertions, 14 deletions
diff --git a/openstack_dashboard/karma.conf.js b/openstack_dashboard/karma.conf.js
index 5a7de8a18..0b4cb434f 100644
--- a/openstack_dashboard/karma.conf.js
+++ b/openstack_dashboard/karma.conf.js
@@ -64,23 +64,43 @@ module.exports = function(config) {
xstaticPath + 'spin/data/spin.js',
xstaticPath + 'spin/data/spin.jquery.js',
- // TODO: Should these be mocked?
+ // TODO: These should be mocked.
'../../horizon/static/horizon/js/horizon.js',
'../../horizon/static/framework/util/http/http.js',
- 'openstack-service-api/openstack-service-api.module.js',
- 'openstack-service-api/**/*.js',
-
- // first load dependencies in order that matters
- "app/app.module.js",
- "dashboard/dashboard.module.js",
- "dashboard/workflow/workflow.js",
- "dashboard/launch-instance/launch-instance.js",
- "dashboard/tech-debt/tech-debt.module.js",
- "dashboard/**/*.js",
-
- // Templates.
- './**/*.html'
+ /**
+ * First, list all the files that defines application's angular modules.
+ * Those files have extension of `.module.js`. The order among them is
+ * not significant.
+ */
+ '**/*.module.js',
+ '**/workflow.js',
+ '**/launch-instance.js',
+
+ /**
+ * Followed by other JavaScript files that defines angular providers
+ * on the modules defined in files listed above. And they are not mock
+ * files or spec files defined below. The order among them is not
+ * significant.
+ */
+ '**/!(*.spec|*.mock).js',
+
+ /**
+ * Then, list files for mocks with `mock.js` extension. The order
+ * among them should not be significant.
+ */
+ '**/*.mock.js',
+
+ /**
+ * Finally, list files for spec with `spec.js` extension. The order
+ * among them should not be significant.
+ */
+ '**/*.spec.js',
+
+ /**
+ * Angular external templates
+ */
+ '**/*.html'
],
autoWatch : true,