From 61b8a81a4c23affff1544f1114b8120b7ca812b8 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 28 Apr 2017 19:17:33 +0200 Subject: [PATCH] test-generators: Add header/footer() functions --- lib/test-generators.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/test-generators.js b/lib/test-generators.js index 6eea655..192f574 100644 --- a/lib/test-generators.js +++ b/lib/test-generators.js @@ -27,6 +27,14 @@ qunit.testOnly = function(relativePath, errors, results) { `});\n`; }; +qunit.header = function(group) { + return `QUnit.module('ESLint | ${escape(group)}');\n`; +}; + +qunit.footer = function() { + return ''; +}; + function mocha(relativePath, errors, results) { let passed = hasPassed(results); let message = createAssertionMessage(relativePath, results); @@ -51,6 +59,14 @@ mocha.testOnly = function(relativePath, errors, results) { ); }; +mocha.header = function(group) { + return `describe('ESLint | ${escape(group)}', function() {\n`; +}; + +mocha.footer = function() { + return '});\n'; +}; + function mochaAssertion(passed, message) { if (passed) { return ` // ESLint passed\n`;