// ♓🌟 Piscēs ∷ object.test.js
// ====================================================================
//
-// Copyright © 2022 Lady [@ Lady’s Computer].
+// Copyright © 2022–2023 Lady [@ Lady’s Computer].
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
} from "./object.js";
describe("LazyLoader", () => {
- const symbol = Symbol();
+ const symbol = Symbol("foo");
const prototype = {};
const etaoinMethod = spy(() => "success");
const shrdluMethod = spy(() => "success");
for (const key of Reflect.ownKeys(ll)) {
yield [
key,
- Object.getOwnPropertyDescriptor(ll, key).get !== void {},
+ Object.getOwnPropertyDescriptor(ll, key).get?.name,
];
}
}(new LazyLoader(methodsObject)),
),
{
- etaoin: true,
- shrdlu: true,
- cmfwyp: true,
- vbgkqj: true,
- xzfiflffffi: true,
- [symbol]: true,
+ etaoin: "get etaoin",
+ shrdlu: "get shrdlu",
+ cmfwyp: "get cmfwyp",
+ vbgkqj: "get vbgkqj",
+ xzfiflffffi: "get xzfiflffffi",
+ [symbol]: `get [${symbol.description}]`,
},
);
});
for (const key of Reflect.ownKeys(ll)) {
yield [
key,
- Object.getOwnPropertyDescriptor(ll, key).set !== void {},
+ Object.getOwnPropertyDescriptor(ll, key).set?.name,
];
}
}(new LazyLoader(methodsObject)),
),
{
- etaoin: false,
- shrdlu: false,
- cmfwyp: false,
- vbgkqj: false,
- xzfiflffffi: false,
- [symbol]: true,
+ etaoin: undefined,
+ shrdlu: undefined,
+ cmfwyp: undefined,
+ vbgkqj: undefined,
+ xzfiflffffi: undefined,
+ [symbol]: `set [${symbol.description}]`,
},
);
});
- describe("[[Construct]] creates a new object with correct getter behaviour", () => {
+ it("[[Construct]] creates a new object with correct getter behaviour", () => {
const ll = new LazyLoader(methodsObject);
ll.etaoin;
assertEquals(
assertThrows(() => ll[symbol]);
});
- describe("[[Construct]] creates a new object with correct setter behaviour", () => {
+ it("[[Construct]] creates a new object with correct setter behaviour", () => {
const ll = new LazyLoader(methodsObject);
ll[symbol] = "success";
assertEquals(