Skip to content

Commit

Permalink
chore: fix test helper eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchcorn committed Dec 19, 2024
1 parent 47baa02 commit 118cb1e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/node-vibrant/__tests__/common/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ const assertPalette = (reference: Palette, palette: Palette) => {
let failCount = 0;
const compare = (
name: string,
expected: Swatch | null,
actual: Swatch | null,
expected: Swatch | undefined | null,
actual: Swatch | undefined | null,
) => {
const result = {
status: "N/A",
diff: -1,
};

if (expected === null) {
if (actual !== null) {
if (!expected) {
if (actual) {
console.warn(`WARN: ${name} color was not expected. Got ${actual.hex}`);
}
} else {
Expand All @@ -53,8 +53,8 @@ const assertPalette = (reference: Palette, palette: Palette) => {
const expectedRow = ["Expected"];
const scoreRow = ["Score"];
for (const name of names) {
const actual = palette[name]!;
const expected = reference[name]!;
const actual = palette[name];
const expected = reference[name];
actualRow.push(actual ? actual.hex : "null");
expectedRow.push(expected ? util.rgbToHex(...expected.rgb) : "null");
const r = compare(name, expected, actual);
Expand Down

0 comments on commit 118cb1e

Please sign in to comment.