Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lolmaus committed Nov 23, 2023
1 parent 0bb189c commit 89e1892
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 33 deletions.
4 changes: 2 additions & 2 deletions addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function setupDeprecationWorkflow(config) {
};

registerDeprecationHandler((message, options, next) =>
handleDeprecationWorkflow(config, message, options, next)
handleDeprecationWorkflow(config, message, options, next),
);

registerDeprecationHandler(deprecationCollector);
Expand Down Expand Up @@ -87,7 +87,7 @@ export function handleDeprecationWorkflow(config, message, options, next) {
console.warn('DEPRECATION: ' + message);
if (count === LOG_LIMIT) {
console.warn(
'To avoid console overflow, this deprecation will not be logged any more in this run.'
'To avoid console overflow, this deprecation will not be logged any more in this run.',
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/flush-deprecations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ setupDeprecationWorkflow({
{ handler: "silence", matchId: "test" },
{ handler: "silence", matchId: "log-strict" }
]
});`
});`,
);
});
});
14 changes: 7 additions & 7 deletions tests/unit/deprecation-collector-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module('deprecationCollector', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);
deprecationCollector(
'Second deprecation',
Expand All @@ -47,7 +47,7 @@ module('deprecationCollector', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);

assert.deepEqual(self.deprecationWorkflow.deprecationLog.messages, {
Expand All @@ -71,7 +71,7 @@ module('deprecationCollector', function (hooks) {
until: 'forever',
for: 'testing',
},
next
next,
);
});

Expand All @@ -84,7 +84,7 @@ module('deprecationCollector', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);
deprecationCollector(
'Second deprecation',
Expand All @@ -94,7 +94,7 @@ module('deprecationCollector', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);

// do it again
Expand All @@ -106,7 +106,7 @@ module('deprecationCollector', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);
deprecationCollector(
'Second deprecation',
Expand All @@ -116,7 +116,7 @@ module('deprecationCollector', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);

assert.deepEqual(self.deprecationWorkflow.deprecationLog.messages, {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/flush-deprecations-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ setupDeprecationWorkflow({
{ handler: "silence", matchId: "first" },
{ handler: "silence", matchId: "second" }
]
});`
});`,
);
});
});
43 changes: 21 additions & 22 deletions tests/unit/handle-deprecation-workflow-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ module('handleDeprecationWorkflow', function (hooks) {
});

test('specifying `throwOnUnhandled` as true raises', function (assert) {
assert.expect(2);

const config = {
throwOnUnhandled: true,
workflow: [{ handler: 'silence', matchMessage: 'Sshhhhh!!' }],
Expand All @@ -46,11 +44,11 @@ module('handleDeprecationWorkflow', function (hooks) {
id: 'foobar',
for: 'testing',
},
() => {}
() => {},
);
},
/Foobarrrzzzz/,
'setting raiseOnUnhandled throws for unknown workflows'
'setting raiseOnUnhandled throws for unknown workflows',
);

handleDeprecationWorkflow(
Expand All @@ -62,14 +60,12 @@ module('handleDeprecationWorkflow', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);
assert.ok(true, 'did not throw when silenced');
});

test('specifying `throwOnUnhandled` as false does nothing', function (assert) {
assert.expect(1);

const config = {
throwOnUnhandled: false,
};
Expand All @@ -83,7 +79,7 @@ module('handleDeprecationWorkflow', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);

assert.ok(true, 'does not die when throwOnUnhandled is false');
Expand All @@ -103,6 +99,7 @@ module('handleDeprecationWorkflow', function (hooks) {
assert.ok(true, 'Deprecation did not raise');
});

// eslint-disable-next-line qunit/require-expect
test('deprecation logs with string matcher', function (assert) {
assert.expect(1);

Expand All @@ -111,7 +108,7 @@ module('handleDeprecationWorkflow', function (hooks) {
assert.strictEqual(
passedMessage.indexOf('DEPRECATION: ' + message),
0,
'deprecation logs'
'deprecation logs',
);
};

Expand All @@ -128,7 +125,7 @@ module('handleDeprecationWorkflow', function (hooks) {
id: 'interesting',
for: 'testing',
},
() => {}
() => {},
);
});

Expand All @@ -147,7 +144,7 @@ module('handleDeprecationWorkflow', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);
}, 'deprecation throws');
});
Expand All @@ -166,22 +163,23 @@ module('handleDeprecationWorkflow', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);

assert.ok(true, 'Deprecation did not raise');
});

// eslint-disable-next-line qunit/require-expect
test('deprecation logs with regex matcher', function (assert) {
assert.expect(1);

let message = 'Interesting';

console.warn = function (passedMessage) {
assert.equal(
assert.strictEqual(
passedMessage,
'DEPRECATION: ' + message,
'deprecation logs'
'deprecation logs',
);
};

Expand All @@ -198,7 +196,7 @@ module('handleDeprecationWorkflow', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);
});

Expand All @@ -217,7 +215,7 @@ module('handleDeprecationWorkflow', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);
}, 'deprecation throws');
});
Expand All @@ -240,7 +238,7 @@ module('handleDeprecationWorkflow', function (hooks) {
until: 'forever',
for: 'testing',
},
() => {}
() => {},
);
}, 'deprecation throws');
});
Expand All @@ -259,22 +257,23 @@ module('handleDeprecationWorkflow', function (hooks) {
until: '3.0.0',
for: 'testing',
},
() => {}
() => {},
);

assert.ok(true, 'Deprecation did not raise');
});

// eslint-disable-next-line qunit/require-expect
test('deprecation logs with id matcher', function (assert) {
assert.expect(1);

let message = 'Slightly interesting';

console.warn = function (passedMessage) {
assert.equal(
assert.strictEqual(
passedMessage,
'DEPRECATION: ' + message,
'deprecation logs'
'deprecation logs',
);
};

Expand All @@ -291,7 +290,7 @@ module('handleDeprecationWorkflow', function (hooks) {
until: '3.0.0',
for: 'testing',
},
() => {}
() => {},
);
});

Expand All @@ -309,7 +308,7 @@ module('handleDeprecationWorkflow', function (hooks) {
until: '3.0.0',
for: 'testing',
},
() => {}
() => {},
);
}, 'deprecation throws');
});
Expand Down

0 comments on commit 89e1892

Please sign in to comment.