Blame view

bower_components/prism/tests/run.js 980 Bytes
eb240478   Luigi Serra   public room cards...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  "use strict";
  
  var TestDiscovery = require("./helper/test-discovery");
  var TestCase = require("./helper/test-case");
  var path = require("path");
  var argv = require("yargs").argv;
  
  var testSuite;
  if (argv.language) {
  	testSuite = TestDiscovery.loadSomeTests(__dirname + "/languages", argv.language);
  } else {
  	// load complete test suite
  	testSuite = TestDiscovery.loadAllTests(__dirname + "/languages");
  }
  
  // define tests for all tests in all languages in the test suite
  for (var language in testSuite) {
  	if (!testSuite.hasOwnProperty(language)) {
  		continue;
  	}
  
  	(function (language, testFiles) {
  		describe("Testing language '" + language + "'", function () {
  			testFiles.forEach(
  				function (filePath) {
  					var fileName = path.basename(filePath, path.extname(filePath));
  
  					it("– should pass test case '" + fileName + "'",
  						function () {
  							TestCase.runTestCase(language, filePath);
  						}
  					);
  				}
  			);
  		});
  	})(language, testSuite[language]);
  }