We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c40365 commit 185dd40Copy full SHA for 185dd40
lib/rules/no-identical-tests.js
@@ -33,7 +33,7 @@ module.exports = {
33
// Helpers
34
// ----------------------------------------------------------------------
35
/**
36
- *compare two test cases depite of properties order.
+ *compare two test cases despite of properties order.
37
*@returns {boolean} if eq, return true, else return false.
38
*/
39
function eq (ta, tb) {
@@ -54,11 +54,11 @@ module.exports = {
54
}
55
56
// convert array to object
57
- const paObj = pa.reduce((result, item) => {
+ const paObj = Object.create(null);
58
+ pa.forEach(item => {
59
const code = sourceCode.getText(item);
- result[code] = true;
60
- return result;
61
- }, {});
+ paObj[code] = true;
+ });
62
63
for (let i = 0; i < pb.length; i++) {
64
const code = sourceCode.getText(pb[i]);
0 commit comments