Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Veneman committed Dec 29, 2023
1 parent 98bbe1c commit 7c7ebaa
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions src/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { suite } from "uvu";
import * as assert from "uvu/assert";
import { suite } from "uvu"
import * as assert from "uvu/assert"
import {
analyze,
compareSpecificity,
Expand All @@ -12,62 +12,62 @@ import {
isPropertyHack,
isValuePrefixed,
hasVendorPrefix,
} from "./index.js";
} from "./index.js"

const Api = suite("Public API");
const Api = suite("Public API")

Api("exposes the 'analyze' method", () => {
assert.is(typeof analyze, "function");
});
assert.is(typeof analyze, "function")
})

Api('exposes the "compareSpecificity" method', () => {
assert.is(typeof compareSpecificity, "function");
});
assert.is(typeof compareSpecificity, "function")
})

Api('exposes the "selectorComplexity" method', () => {
assert.is(typeof selectorComplexity, "function");
});
assert.is(typeof selectorComplexity, "function")
})

Api('exposes the "isSelectorPrefixed" method', () => {
assert.is(typeof isSelectorPrefixed, "function");
});
assert.is(typeof isSelectorPrefixed, "function")
})

Api('exposes the "isAccessibilitySelector" method', () => {
assert.is(typeof isAccessibilitySelector, "function");
});
assert.is(typeof isAccessibilitySelector, "function")
})

Api('exposes the "isMediaBrowserhack" method', () => {
assert.is(typeof isMediaBrowserhack, "function");
});
assert.is(typeof isMediaBrowserhack, "function")
})

Api('exposes the "isSupportsBrowserhack" method', () => {
assert.is(typeof isSupportsBrowserhack, "function");
});
assert.is(typeof isSupportsBrowserhack, "function")
})

Api('exposes the "isValueBrowserhack" method', () => {
assert.is(typeof isValueBrowserhack, "function");
});
assert.is(typeof isValueBrowserhack, "function")
})

Api('exposes the "isPropertyHack" method', () => {
assert.is(typeof isPropertyHack, "function");
});
assert.is(typeof isPropertyHack, "function")
})

Api('exposes the "isValuePrefixed" method', () => {
assert.is(typeof isValuePrefixed, "function");
});
assert.is(typeof isValuePrefixed, "function")
})

Api('exposes the "hasVendorPrefix" method', () => {
assert.is(typeof hasVendorPrefix, "function");
});
assert.is(typeof hasVendorPrefix, "function")
})

Api("does not break on CSS Syntax Errors", () => {
assert.not.throws(() => analyze("test, {}"));
assert.not.throws(() => analyze("test { color red }"));
});
assert.not.throws(() => analyze("test, {}"))
assert.not.throws(() => analyze("test { color red }"))
})

Api("handles empty input gracefully", () => {
const actual = analyze("");
delete actual.__meta__;
const actual = analyze("")
delete actual.__meta__
const expected = {
stylesheet: {
sourceLinesOfCode: 0,
Expand Down Expand Up @@ -462,18 +462,18 @@ Api("handles empty input gracefully", () => {
sum: 0,
}
},
};
}

assert.equal(actual, expected);
});
assert.equal(actual, expected)
})

Api("has metadata", () => {
const fixture = Array.from({ length: 100 })
.map(
(_) => `
html {
font: 1em/1 sans-serif;
color: rgb(0 0 0 / 0.5)
color: rgb(0 0 0 / 0.5);
}
@media screen {
Expand All @@ -486,28 +486,28 @@ Api("has metadata", () => {
}
`
)
.join("");
.join("")

const result = analyze(fixture);
const actual = result.__meta__;
const result = analyze(fixture)
const actual = result.__meta__

assert.type(actual.parseTime, "number");
assert.type(actual.parseTime, "number")
assert.ok(
actual.parseTime > 0,
`expected parseTime to be bigger than 0, got ${actual.parseTime}`
);
)

assert.type(actual.analyzeTime, "number");
assert.type(actual.analyzeTime, "number")
assert.ok(
actual.analyzeTime > 0,
`expected analyzeTime to be bigger than 0, got ${actual.parseTime}`
);
)

assert.type(actual.total, "number");
assert.type(actual.total, "number")
assert.ok(
actual.total > 0,
`expected total time to be bigger than 0, got ${actual.parseTime}`
);
});
)
})

Api.run();
Api.run()

0 comments on commit 7c7ebaa

Please sign in to comment.