Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
test-generators: Add header/footer() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Apr 28, 2017
1 parent d11a90e commit 61b8a81
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/test-generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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`;
Expand Down

0 comments on commit 61b8a81

Please sign in to comment.