(testCase)
| 77 | |
| 78 | //Normalize input/output |
| 79 | function normalize (testCase) { |
| 80 | |
| 81 | // Normalize line returns |
| 82 | testCase.expected = testCase.expected.replace(/(\r\n)|\n|\r/g, '\n'); |
| 83 | testCase.actual = testCase.actual.replace(/(\r\n)|\n|\r/g, '\n'); |
| 84 | |
| 85 | // Ignore all leading/trailing whitespace |
| 86 | testCase.expected = testCase.expected.split('\n').map(function (x) { |
| 87 | return x.trim(); |
| 88 | }).join('\n'); |
| 89 | testCase.actual = testCase.actual.split('\n').map(function (x) { |
| 90 | return x.trim(); |
| 91 | }).join('\n'); |
| 92 | |
| 93 | // Remove extra lines |
| 94 | testCase.expected = testCase.expected.trim(); |
| 95 | testCase.actual = testCase.actual.trim(); |
| 96 | |
| 97 | //Beautify |
| 98 | //testCase.expected = beautify(testCase.expected, beauOptions); |
| 99 | //testCase.actual = beautify(testCase.actual, beauOptions); |
| 100 | |
| 101 | // Normalize line returns |
| 102 | testCase.expected = testCase.expected.replace(/(\r\n)|\n|\r/g, '\n'); |
| 103 | testCase.actual = testCase.actual.replace(/(\r\n)|\n|\r/g, '\n'); |
| 104 | |
| 105 | return testCase; |
| 106 | } |
| 107 | |
| 108 | module.exports = { |
| 109 | getTestSuite: getTestSuite, |
no outgoing calls
no test coverage detected
searching dependent graphs…