Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Setting up Testacular test suite for DFXP library.

  • Loading branch information...
commit ba8c73ee67aa6a9124eb8321af2a2effb2be0926 1 parent 83707b8
@nicksergeant nicksergeant authored
View
1  .gitignore
@@ -76,3 +76,4 @@ apps/webdriver_testing/Results/*.png
apps/webdriver_testing/Results/nosetests.xml
apps/webdriver_testing/Results/results.html
unisubsdevemails/
+testacular-test-results.xml
View
17 media/src/js/dfxp/dfxp.test.js
@@ -1,17 +0,0 @@
-// Amara, universalsubtitles.org
-//
-// Copyright (C) 2012 Participatory Culture Foundation
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Affero General Public License as
-// published by the Free Software Foundation, either version 3 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Affero General Public License for more details.
-//
-// You should have received a copy of the GNU Affero General Public License
-// along with this program. If not, see
-// http://www.gnu.org/licenses/agpl-3.0.html.
View
1  media/src/js/dfxp/sample.dfxp.xml.js
1 addition, 0 deletions not shown
View
16 media/src/js/tests/dfxp.tests.js
@@ -0,0 +1,16 @@
+describe('DFXP', function() {
+
+ var parser = new AmaraDFXPParser();
+
+ describe('#init()', function() {
+ it('should initialize a set of mock subtitles', function() {
+
+ // Initialize the parser with a sample XML string.
+ parser.init(sampleXmlString);
+
+ // Our sample set of subtitles should contain 1,919 subtitles.
+ expect(parser.getSubtitles().length).toBe(1919);
+
+ });
+ });
+});
View
65 testacular.conf.js
@@ -0,0 +1,65 @@
+/*
+ * See https://github.com/vojtajina/testacular/blob/master/test/client/testacular.conf.js
+ */
+
+// All file references here will be relative to this.
+basePath = 'media/src/js';
+
+// Files to include.
+files = [
+ JASMINE,
+ JASMINE_ADAPTER,
+ 'third-party/amara-jquery-1.8.2.min.js',
+ 'dfxp/sample.dfxp.xml.js',
+ 'dfxp/dfxp.js',
+ 'tests/dfxp.tests.js'
+];
+
+// Files to exclude.
+exclude = [];
+
+reporters = ['progress', 'junit'];
+
+junitReporter = {
+ outputFile: 'testacular-test-results.xml'
+};
+
+// Web server port.
+port = 9876;
+
+// CLI runner port.
+runnerPort = 9100;
+
+// CLI colors?
+colors = true;
+
+/* Logging level.
+ *
+ * One of [LOG_DISABLE, LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG]
+ */
+logLevel = LOG_INFO;
+
+// Executes tests when any files change.
+autoWatch = true;
+
+/* Browsers to start.
+ *
+ * One of: [
+ * Chrome,
+ * ChromeCanary,
+ * Firefox,
+ * Opera,
+ * Safari,
+ * PhantomJS,
+ * IE,
+ * ]
+ */
+browsers = ['ChromeCanary'];
+
+captureTimeout = 5000;
+
+// Auto-run tests on start and exit?
+singleRun = false;
+
+// Report specs slower than this.
+reportSlowerThan = 500;
Please sign in to comment.
Something went wrong with that request. Please try again.