Commit 829f8a860dbd6426213c3e0c3cd2afb22d3591d1

Jannik Zschiesche 2015-06-13T15:24:53

New file extension for test case files: .test ## All test case files are now required to have the ".test" extension. This prevents issues with syntax highlighting in common IDEs and also prevents the test system to choke on non-testcase files in these directories (like `.DS_Store` or `Thumbs.db`). ## Hide the ".test" extension in the description of the test cases The message for a testcase `blabla.test` will now just read: > 1) Testing language 'css' – should pass test case 'blabla':

diff --git a/tests/helper/test-discovery.js b/tests/helper/test-discovery.js
index 9f9ea2d..7cbaef8 100644
--- a/tests/helper/test-discovery.js
+++ b/tests/helper/test-discovery.js
@@ -52,7 +52,9 @@ module.exports = {
 	getAllFiles: function (src) {
 		return fs.readdirSync(src).filter(
 			function (fileName) {
-				return fs.statSync(path.join(src, fileName)).isFile();
+				// only find files that have the ".test" extension
+				return ".test" === path.extname(fileName) &&
+					fs.statSync(path.join(src, fileName)).isFile();
 			}
 		).map(
 			function (fileName) {
diff --git a/tests/run.js b/tests/run.js
index 32dab49..0f0475f 100644
--- a/tests/run.js
+++ b/tests/run.js
@@ -18,7 +18,7 @@ for (var language in testSuite)
 		describe("Testing language '" + language + "'", function() {
 			testFiles.forEach(
 				function (filePath) {
-					var fileName = path.basename(filePath);
+					var fileName = path.basename(filePath, path.extname(filePath));
 
 					it("– should pass test case '" + fileName + "'",
 						function () {