Whoo got unit tests that are failing...

This commit is contained in:
Lani Aung
2025-06-07 15:26:51 -07:00
parent 5e9039efad
commit 44053555ec
15 changed files with 2472 additions and 114 deletions
+21
View File
@@ -0,0 +1,21 @@
import HSL from "../src/hsl"
import RGB from "../src/rgb"
describe("HSL", () => {
it("should match provided base RBG values", () => {
const red = HSL.fromRgb(new RGB(255, 0, 0))
expect(red.hue).toEqual(0)
expect(red.lightness).toEqual(.5)
expect(red.saturation).toEqual(1)
const green = HSL.fromRgb(new RGB(0, 255, 0))
expect(green.hue).toEqual(120)
expect(green.lightness).toEqual(.5)
expect(green.saturation).toEqual(1)
const blue = HSL.fromRgb(new RGB(0, 0, 255))
expect(blue.hue).toEqual(240)
expect(blue.lightness).toEqual(.5)
expect(blue.saturation).toEqual(1)
})
})
+32
View File
@@ -0,0 +1,32 @@
export default {
srcDir: "src",
srcFiles: [
"**/*.js"
],
specDir: "www",
specFiles: [
"test.js"
],
helpers: [
"helpers/**/*.js"
],
env: {
stopSpecOnExpectationFailure: false,
stopOnSpecFailure: false,
random: true,
// Fail if a suite contains multiple suites or specs with the same name.
forbidDuplicateNames: true
},
// For security, listen only to localhost. You can also specify a different
// hostname or IP address, or remove the property or set it to "*" to listen
// to all network interfaces.
listenAddress: "localhost",
// The hostname that the browser will use to connect to the server.
hostname: "localhost",
browser: {
name: "firefox"
}
};