From 0e7f50be0ad1e404e14783dd5d6d127e6423684a Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Mon, 4 Feb 2019 09:49:31 +0100 Subject: [PATCH] Include delimiter to guess tests on custom tests --- tests/test-cases.js | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/tests/test-cases.js b/tests/test-cases.js index 72338f1..0b34f0d 100644 --- a/tests/test-cases.js +++ b/tests/test-cases.js @@ -2187,26 +2187,7 @@ var CUSTOM_TESTS = [ } }); } - } -]; - -describe('Custom Tests', function() { - function generateTest(test) { - (test.disabled ? it.skip : it)(test.description, function(done) { - test.run(function(actual) { - assert.deepEqual(JSON.stringify(actual), JSON.stringify(test.expected)); - done(); - }); - }); - } - - for (var i = 0; i < CUSTOM_TESTS.length; i++) { - generateTest(CUSTOM_TESTS[i]); - } -}); - - -var DELIMITERS_TO_GUESS_TESTS = [ + }, { description: "Should correctly guess custom delimiter when passed delimiters to guess.", expected: "~", @@ -2227,7 +2208,7 @@ var DELIMITERS_TO_GUESS_TESTS = [ } ]; -describe('Delimiters to Guess Tests', function() { +describe('Custom Tests', function() { function generateTest(test) { (test.disabled ? it.skip : it)(test.description, function(done) { test.run(function(actual) { @@ -2237,7 +2218,7 @@ describe('Delimiters to Guess Tests', function() { }); } - for (var i = 0; i < DELIMITERS_TO_GUESS_TESTS.length; i++) { - generateTest(DELIMITERS_TO_GUESS_TESTS[i]); + for (var i = 0; i < CUSTOM_TESTS.length; i++) { + generateTest(CUSTOM_TESTS[i]); } });