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


TypeScript assert.containSubset方法代码示例

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


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

示例1: test

 test('Extracts attributes from observedAttributes', () => {
   const element = elements.get('vanilla-with-observed-attributes')!;
   assert.containSubset(Array.from(element.attributes.values()), [
     {
       description: 'When given the element is totally inactive',
       name: 'disabled',
       type: 'boolean',
       sourceRange:
           {start: {column: 6, line: 25}, end: {column: 16, line: 25}}
     },
     {
       description: 'When given the element is expanded',
       name: 'open',
       type: 'boolean',
       sourceRange:
           {start: {column: 6, line: 27}, end: {column: 12, line: 27}}
     },
     {
       description: '',
       name: 'foo',
       sourceRange:
           {start: {column: 14, line: 27}, end: {column: 19, line: 27}},
     },
     {
       description: '',
       name: 'bar',
       sourceRange:
           {start: {column: 21, line: 27}, end: {column: 26, line: 27}},
     }
   ]);
 });
开发者ID:MehdiRaash,项目名称:tools,代码行数:31,代码来源:polymer2-element-scanner_vanilla-elements_test.ts

示例2: test

  test('warns for non-resolvable bare specifiers', async () => {
    const {features, warnings} = await runScanner(
        analyzer,
        new JavaScriptImportScanner({moduleResolution: 'node'}),
        'javascript/module-with-not-found-named-import.js');

    assert.equal(warnings.length, 1);
    assert.containSubset(warnings, [{code: 'cant-resolve-module-specifier'}]);
    assert.containSubset(features, [
      {
        type: 'js-import',
        url: undefined,
        lazy: false,
      },
    ]);
  });
开发者ID:MehdiRaash,项目名称:tools,代码行数:16,代码来源:javascript-import-scanner_test.ts

示例3: test

 test('finds imports', async () => {
   const {features} = await runScanner(
       analyzer, new JavaScriptImportScanner(), 'javascript/module.js');
   assert.containSubset(features, [
     {
       type: 'js-import',
       url: './submodule.js',
       lazy: false,
     },
   ]);
 });
开发者ID:asdfg9822,项目名称:polymer-analyzer,代码行数:11,代码来源:javascript-import-scanner_test.ts

示例4: test

  test('can infer properties assigned to in the constructor', async () => {
    const elements = await getElements('test-element-16.js');
    const [element] = elements;
    const elementData = await Promise.all(elements.map(getTestProps));
    assert.deepEqual(elementData, [
      {
        className: 'TestElement',
        tagName: 'test-element',
        superClass: 'Polymer.Element',
        description: '',
        summary: '',
        attributes: [],
        properties: [
          {
            name: 'foo',
            description: 'This description lives in the constructor.',
            type: 'string | null | undefined'
          },
          {
            name: 'constructorOnly_',
            description: 'This is a private field on the element.',
            type: 'number'
          }
        ],
        methods: [],
        warningUnderlines: [],
      },
    ]);

    assert.containSubset([...element.properties.values()], [
      {
        name: 'foo',
        privacy: 'protected',
        description: 'This description lives in the constructor.',
        type: 'string | null | undefined',
        default: `'bar'`,
        published: true,
        notify: true,
        warnings: [],
      },
      {
        name: 'constructorOnly_',
        privacy: 'private',
        description: 'This is a private field on the element.',
        type: 'number',
        readOnly: true,
        warnings: [],
      }
    ]);
  });
开发者ID:Polymer,项目名称:tools,代码行数:50,代码来源:polymer2-element-scanner_test.ts

示例5: test

    test(testName, async () => {
      getReleasesStub.returns(Promise.resolve(basicReleasesResponse));

      const release = await github.getSemverRelease('^v2.0.0');
      assert.containSubset(release, {name: 'v2.1.0'});
    });
开发者ID:poehlmann,项目名称:EvaluacionDiferencialDeLaMemoria,代码行数:6,代码来源:github_test.ts


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