MCPcopy
hub / github.com/showdownjs/showdown / normalize

Function normalize

test/bootstrap.js:79–106  ·  view source on GitHub ↗
(testCase)

Source from the content-addressed store, hash-verified

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,

Callers 1

assertionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…