当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript assert.deepInclude方法代码示例

本文整理汇总了TypeScript中chai.assert.deepInclude方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.deepInclude方法的具体用法?TypeScript assert.deepInclude怎么用?TypeScript assert.deepInclude使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chai.assert的用法示例。


在下文中一共展示了assert.deepInclude方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

    it("returns a list of the children", function() {
      const usEast: LocalityTree = {
        tiers: [{ key: "region", value: "us-east" }],
        localities: {},
        nodes: [],
      };

      const usWest: LocalityTree = {
        tiers: [{ key: "region", value: "us-west" }],
        localities: {},
        nodes: [],
      };

      const locality: LocalityTree = {
        tiers: [],
        localities: {
          region: {
            "us-east": usEast,
            "us-west": usWest,
          },
        },
        nodes: [],
      };

      const children = getChildLocalities(locality);

      assert.lengthOf(children, 2);
      assert.deepInclude(children, usEast);
      assert.deepInclude(children, usWest);
    });
开发者ID:a6802739,项目名称:cockroach,代码行数:30,代码来源:localities.spec.ts

示例2: test

    test('finds properties', async () => {
      const cls = (await getScannedClasses('class/class-properties.js'))[0];

      assert.deepInclude(cls.properties.get('customPropertyGetterType'), {
        name: 'customPropertyGetterType',
        type: 'boolean',
        description: 'A boolean getter',
        readOnly: true
      });

      assert.deepInclude(cls.properties.get('customPropertyWithGetterSetter'), {
        name: 'customPropertyWithGetterSetter',
        description: 'a property with a getter/setter',
        readOnly: false
      });

      assert.deepInclude(
          cls.properties.get('customPropertyWithReadOnlyGetter'),
          {name: 'customPropertyWithReadOnlyGetter', readOnly: true});

      assert.deepInclude(
          cls.properties.get('customPropertyOnProto'),
          {name: 'customPropertyOnProto', type: 'string'});

      assert.deepInclude(
          cls.properties.get('customPropertyOnProtoValue'),
          {name: 'customPropertyOnProtoValue', type: 'number'});

      assert.deepInclude(cls.properties.get('customPropertyOnProtoDoc'), {
        name: 'customPropertyOnProtoDoc',
        description: 'A property',
        type: '(boolean | number)',
        privacy: 'private',
        readOnly: true
      });

      assert.deepInclude(
          cls.properties.get('__customPropertyOnProtoPrivate'),
          {name: '__customPropertyOnProtoPrivate', privacy: 'private'});

      assert.deepEqual(await getTestProps(cls), {
        name: 'Class',
        constructorMethod: {description: '', name: 'constructor'},
        description: '',
        privacy: 'public',
        properties: [
          {name: 'customPropertyWithValue'},
          {name: 'customPropertyWithJSDoc'},
          {name: 'customPropertyGetter'},
          {name: 'customPropertyGetterType'},
          {name: 'customPropertyWithGetterSetter'},
          {name: 'customPropertyWithSetterFirst'},
          {name: 'customPropertyWithReadOnlyGetter'},
          {name: 'customPropertyOnProto'},
          {name: 'customPropertyOnProtoValue'},
          {name: 'customPropertyOnProtoDoc'},
          {name: '__customPropertyOnProtoPrivate'}
        ]
      });
    });
开发者ID:Polymer,项目名称:tools,代码行数:60,代码来源:class-scanner_test.ts


注:本文中的chai.assert.deepInclude方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。