<commit_before>/**
 * File with tests showing current limitations.
 *
 * note: tests may be need to be disabled until they work correctly.
 */
import {
   Reflective,
   mustGetType,
   mustGetPropType,
   getType,
   getPropType,
   Types
} from '../src/types'

class OuterClass {

}

@Reflective
class TestClass {
   type_prop: typeof OuterClass = OuterClass;
}


@Reflective
class ParentClass {
   children: (OuterClass|TestClass)[] = [];
}

describe('Missing Support', () => {
   it('should support "type of" types', () => {
      // should allow supporting type of types
      const type_prop_type = getPropType(TestClass, "type_prop") as Types.UnknownType;
      expect(type_prop_type.kind).toBe(Types.TypeKind.Unknown);
   });

   it('should support class union arrays', () => {
      // Should allow reflection of the types that make up the array
      const children_type = getPropType(ParentClass, "children") as Types.ReferenceType;
      expect(children_type.kind).toBe(Types.TypeKind.Reference);
      expect(children_type.type).toEqual(Array);
      expect(children_type.arguments[0].kind).toBe(Types.TypeKind.Unknown);
   });

});<commit_msg>Add spec showing that nested classes fail.<commit_after>/**
 * File with tests showing current limitations.
 *
 * note: tests may be need to be disabled until they work correctly.
 */
import {
   Reflective,
   mustGetType,
   mustGetPropType,
   getType,
   getPropType,
   Types
} from '../src/types'

class OuterClass {

}

@Reflective
class TestClass {
   type_prop: typeof OuterClass = OuterClass;
}


@Reflective
class ParentClass {
   children: (OuterClass|TestClass)[] = [];
}

describe('Missing Support', () => {
   it('should support "type of" types', () => {
      // should allow supporting type of types
      const type_prop_type = getPropType(TestClass, "type_prop") as Types.UnknownType;
      expect(type_prop_type.kind).toBe(Types.TypeKind.Unknown);
   });

   it('should support class union arrays', () => {
      // Should allow reflection of the types that make up the array
      const children_type = getPropType(ParentClass, "children") as Types.ReferenceType;
      expect(children_type.kind).toBe(Types.TypeKind.Reference);
      expect(children_type.type).toEqual(Array);
      expect(children_type.arguments[0].kind).toBe(Types.TypeKind.Unknown);
   });

   it('should work nested', () => {
      @Reflective
      class InnerClass {
          a: string;
      }

      const clsType = getType(InnerClass);
      // SHOULD WORK
      //expect(clsType).toBeDefined();
   });

});
{'fraction_non_alphanumeric': 0.1240733515411627, 'fraction_numerical': 0.0007803355442840422, 'mean_word_length': 3.474694589877836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6409687', 'n_tokens_mistral': 774, 'n_tokens_neox': 764, 'n_words': 194}