本文整理汇总了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 }
]
}
}
]);
});
示例2: it
it('is an immutable class', () => {
testImmutableClass(LinkItem, [
LinkItemMock.testOneJS(),
LinkItemMock.testTwoJS()
], { context });
});
示例3: it
it('is an immutable class', () => {
testImmutableClass(LinkViewConfig, [
LinkViewConfigMock.testOneOnlyJS(),
LinkViewConfigMock.testOneTwoJS()
], { context });
});
示例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"
}
//.........这里部分代码省略.........
示例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 }
}
}
}
]);
});
示例6: it
it('is an immutable class', () => {
testImmutableClass<DataSourceJS>(DataSource, [
DataSourceMock.TWITTER_JS,
DataSourceMock.WIKI_JS
]);
});
示例7: it
it('is an immutable class', () => {
testImmutableClass(AppSettings, [
AppSettingsMock.wikiOnlyJS(),
AppSettingsMock.wikiTwitterJS()
]);
});