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


TypeScript tester.testImmutableClass函数代码示例

本文整理汇总了TypeScript中immutable-class/build/tester.testImmutableClass函数的典型用法代码示例。如果您正苦于以下问题:TypeScript testImmutableClass函数的具体用法?TypeScript testImmutableClass怎么用?TypeScript testImmutableClass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: it

  it('is an immutable class', () => {
    testImmutableClass<FilterClauseJS>(FilterClause, [
      {
        expression: { op: 'ref', name: 'language' },
        selection: {
          op: 'literal',
          value: {
            "setType": "STRING",
            "elements": ["en"]
          },
          "type": "SET"
        }
      },
      {
        expression: { op: 'ref', name: 'language' },
        selection: {
          op: 'literal',
          value: {
            "setType": "STRING",
            "elements": ["en", null]
          },
          "type": "SET"
        }
      },
      {
        expression: { op: 'ref', name: 'language' },
        selection: {
          op: 'literal',
          value: {
            "setType": "STRING",
            "elements": ["en"]
          },
          "type": "SET"
        },
        exclude: true
      },
      {
        expression: { op: 'ref', name: 'time' },
        selection: {
          op: 'literal',
          value: {
            "setType": "TIME_RANGE",
            "elements": [{ start: new Date('2015-11-11'), end: new Date('2015-11-12') }]
          },
          "type": "SET"
        },
        exclude: true
      },

      // Dynamic!
      {
        expression: { op: 'ref', name: 'language' },
        selection: {
          op: 'chain',
          expression: { op: 'ref', name: 'n' },
          action: { action: 'timeRange', duration: 'P1D', step: -1 }
        }
      },
      {
        expression: { op: 'ref', name: 'language' },
        selection: {
          op: 'chain',
          expression: { op: 'ref', name: 'm' },
          actions: [
            { action: 'timeShift', duration: 'P5D', step: -1 },
            { action: 'timeRange', duration: 'P1D', step: -1 }
          ]
        }
      }
    ]);
  });
开发者ID:fortressll87,项目名称:implydata-pivot,代码行数:71,代码来源:filter-clause.mocha.ts

示例2: it

 it('is an immutable class', () => {
   testImmutableClass(LinkItem, [
     LinkItemMock.testOneJS(),
     LinkItemMock.testTwoJS()
   ], { context });
 });
开发者ID:djfwan,项目名称:pivot,代码行数:6,代码来源:link-item.mocha.ts

示例3: it

 it('is an immutable class', () => {
   testImmutableClass(LinkViewConfig, [
     LinkViewConfigMock.testOneOnlyJS(),
     LinkViewConfigMock.testOneTwoJS()
   ], { context });
 });
开发者ID:RaviNK,项目名称:pivot,代码行数:6,代码来源:link-view-config.mocha.ts

示例4: it

  it('is an immutable class', () => {
    testImmutableClass<DataSourceJS>(DataSource, [
      {
        name: 'twitter',
        title: 'Twitter',
        engine: 'druid',
        source: 'twitter',
        subsetFilter: null,
        introspection: 'none',
        dimensions: [
          {
            expression: {
              name: 'time',
              op: 'ref'
            },
            kind: 'time',
            name: 'time',
            title: 'Time'
          },
          {
            expression: {
              name: 'twitterHandle',
              op: 'ref'
            },
            kind: 'string',
            name: 'twitterHandle',
            title: 'Twitter Handle'
          }
        ],
        measures: [
          {
            name: 'count',
            title: 'count',
            expression: {
              name: 'count',
              op: 'ref'
            }

          }
        ],
        timeAttribute: 'time',
        defaultTimezone: 'Etc/UTC',
        defaultFilter: { op: 'literal', value: true },
        defaultDuration: 'P3D',
        defaultSortMeasure: 'count',
        defaultPinnedDimensions: ['tweet'],
        refreshRule: {
          refresh: "PT1M",
          rule: "fixed"
        }
      },
      {
        name: 'wiki',
        title: 'Wiki',
        engine: 'druid',
        source: 'wiki',
        subsetFilter: null,
        introspection: 'none',
        attributes: [
          { name: 'time', type: 'TIME' },
          { name: 'articleName', type: 'STRING' },
          { name: 'count', type: 'NUMBER', unsplitable: true, makerAction: { action: 'count' } }
        ],
        dimensions: [
          {
            expression: {
              name: 'time',
              op: 'ref'
            },
            kind: 'time',
            name: 'time',
            title: 'Time'
          },
          {
            expression: {
              name: 'articleName',
              op: 'ref'
            },
            kind: 'string',
            name: 'articleName',
            title: 'Article Name'
          }
        ],
        measures: [
          {
            name: 'count',
            title: 'count',
            expression: $('main').sum('$count').toJS()
          }
        ],
        timeAttribute: 'time',
        defaultTimezone: 'Etc/UTC',
        defaultFilter: { op: 'literal', value: true },
        defaultDuration: 'P3D',
        defaultSortMeasure: 'count',
        defaultPinnedDimensions: ['articleName'],
        refreshRule: {
          refresh: "PT1M",
          rule: "fixed"
        }
//.........这里部分代码省略.........
开发者ID:coconutpalm,项目名称:pivot,代码行数:101,代码来源:data-source.mocha.ts

示例5: it

  it('is an immutable class', () => {
    testImmutableClass<FilterJS>(Filter, [
      { op: 'literal', value: true },
      {
        "op": "chain", "expression": { "op": "ref", "name": "language" },
        "action": {
          "action": "overlap",
          "expression": {
            "op": "literal",
            "value": { "setType": "STRING", "elements": ["en"] },
            "type": "SET"
          }
        }
      },
      {
        "op": "chain", "expression": { "op": "ref", "name": "time" },
        "action": {
          "action": "in",
          "expression": {
            "op": "literal",
            "value": { "start": new Date("2013-02-26T19:00:00.000Z"), "end": new Date("2013-02-26T22:00:00.000Z") },
            "type": "TIME_RANGE"
          }
        }
      },
      {
        "op": "chain", "expression": { "op": "ref", "name": "language" },
        "action": {
          "action": "overlap",
          "expression": {
            "op": "literal",
            "value": { "setType": "STRING", "elements": ["he"] },
            "type": "SET"
          }
        }
      },
      {
        "op": "chain",
        "expression": { "op": "ref", "name": "language" },
        "actions": [
          {
            "action": "overlap",
            "expression": {
              "op": "literal",
              "value": { "setType": "STRING", "elements": ["he"] },
              "type": "SET"
            }
          },
          {
            "action": "and",
            "expression": {
              "op": "chain", "expression": { "op": "ref", "name": "namespace" },
              "action": {
                "action": "overlap",
                "expression": {
                  "op": "literal",
                  "value": { "setType": "STRING", "elements": ["wikipedia"] },
                  "type": "SET"
                }
              }
            }
          }
        ]
      },

      // Dynamic
      {
        "op": "chain", "expression": { "op": "ref", "name": "time" },
        "action": {
          "action": "in",
          "expression": {
            op: 'chain',
            expression: { op: 'ref', name: 'n' },
            action: { action: 'timeRange', duration: 'P1D', step: -1 }
          }
        }
      }
    ]);
  });
开发者ID:RaviNK,项目名称:pivot,代码行数:79,代码来源:filter.mocha.ts

示例6: it

 it('is an immutable class', () => {
   testImmutableClass<DataSourceJS>(DataSource, [
     DataSourceMock.TWITTER_JS,
     DataSourceMock.WIKI_JS
   ]);
 });
开发者ID:saeedsh,项目名称:pivot,代码行数:6,代码来源:data-source.mocha.ts

示例7: it

 it('is an immutable class', () => {
   testImmutableClass(AppSettings, [
     AppSettingsMock.wikiOnlyJS(),
     AppSettingsMock.wikiTwitterJS()
   ]);
 });
开发者ID:boneill42,项目名称:pivot,代码行数:6,代码来源:app-settings.mocha.ts


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