+describe("isDataDescriptor", () => {
+ it("[[Call]] returns false for a generic descriptor", () => {
+ assertStrictEquals(isDataDescriptor({}), false);
+ });
+
+ it("[[Get]] returns true for a data descriptor", () => {
+ assertStrictEquals(isDataDescriptor({ value: undefined }), true);
+ assertStrictEquals(isDataDescriptor({ writable: true }), true);
+ });
+
+ it("[[Get]] returns false for an accessor descriptor", () => {
+ assertStrictEquals(isDataDescriptor({ get: undefined }), false);
+ assertStrictEquals(isDataDescriptor({ set: undefined }), false);
+ });
+
+ it("[[Get]] returns false for undefined", () => {
+ assertStrictEquals(isDataDescriptor(undefined), false);
+ });
+
+ it("[[Construct]] throws an error", () => {
+ assertThrows(() => new isDataDescriptor({}));
+ });
+
+ describe(".length", () => {
+ it("[[Get]] returns the correct length", () => {
+ assertStrictEquals(isDataDescriptor.length, 1);
+ });
+ });
+
+ describe(".name", () => {
+ it("[[Get]] returns the correct name", () => {
+ assertStrictEquals(isDataDescriptor.name, "isDataDescriptor");
+ });
+ });
+});
+
+describe("isFullyPopulatedDescriptor", () => {
+ it("[[Call]] returns false for a generic descriptor", () => {
+ assertStrictEquals(isFullyPopulatedDescriptor({}), false);
+ });
+
+ it("[[Get]] returns false for a non‐fully‐populated data descriptor", () => {
+ assertStrictEquals(
+ isFullyPopulatedDescriptor({ value: undefined }),
+ false,
+ );
+ assertStrictEquals(
+ isFullyPopulatedDescriptor({ writable: true }),
+ false,
+ );
+ });
+
+ it("[[Get]] returns true for a fully‐populated data descriptor", () => {
+ assertStrictEquals(
+ isFullyPopulatedDescriptor({
+ configurable: true,
+ enumerable: true,
+ value: undefined,
+ writable: true,
+ }),
+ true,
+ );
+ });
+
+ it("[[Get]] returns false for a non‐fully‐populated accessor descriptor", () => {
+ assertStrictEquals(
+ isFullyPopulatedDescriptor({ get: undefined }),
+ false,
+ );
+ assertStrictEquals(
+ isFullyPopulatedDescriptor({ set: undefined }),
+ false,
+ );
+ });
+
+ it("[[Get]] returns true for a fully‐populated accessor descriptor", () => {
+ assertStrictEquals(
+ isFullyPopulatedDescriptor({
+ configurable: true,
+ enumerable: true,
+ get: undefined,
+ set: undefined,
+ }),
+ true,
+ );
+ });
+
+ it("[[Get]] returns false for undefined", () => {
+ assertStrictEquals(isFullyPopulatedDescriptor(undefined), false);
+ });
+
+ it("[[Construct]] throws an error", () => {
+ assertThrows(() => new isFullyPopulatedDescriptor({}));
+ });
+
+ describe(".length", () => {
+ it("[[Get]] returns the correct length", () => {
+ assertStrictEquals(isFullyPopulatedDescriptor.length, 1);
+ });
+ });
+
+ describe(".name", () => {
+ it("[[Get]] returns the correct name", () => {
+ assertStrictEquals(
+ isFullyPopulatedDescriptor.name,
+ "isFullyPopulatedDescriptor",
+ );
+ });
+ });
+});
+
+describe("isGenericDescriptor", () => {
+ it("[[Call]] returns true for a generic descriptor", () => {
+ assertStrictEquals(isGenericDescriptor({}), true);
+ });
+
+ it("[[Get]] returns false for a data descriptor", () => {
+ assertStrictEquals(
+ isGenericDescriptor({ value: undefined }),
+ false,
+ );
+ assertStrictEquals(isGenericDescriptor({ writable: true }), false);
+ });
+
+ it("[[Get]] returns false for an accessor descriptor", () => {
+ assertStrictEquals(isGenericDescriptor({ get: undefined }), false);
+ assertStrictEquals(isGenericDescriptor({ set: undefined }), false);
+ });
+
+ it("[[Get]] returns false for undefined", () => {
+ assertStrictEquals(isGenericDescriptor(undefined), false);
+ });
+
+ it("[[Construct]] throws an error", () => {
+ assertThrows(() => new isGenericDescriptor({}));
+ });
+
+ describe(".length", () => {
+ it("[[Get]] returns the correct length", () => {
+ assertStrictEquals(isGenericDescriptor.length, 1);
+ });
+ });
+
+ describe(".name", () => {
+ it("[[Get]] returns the correct name", () => {
+ assertStrictEquals(
+ isGenericDescriptor.name,
+ "isGenericDescriptor",
+ );
+ });