本文整理匯總了TypeScript中@influxdata/vis.fromFlux函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript fromFlux函數的具體用法?TypeScript fromFlux怎麽用?TypeScript fromFlux使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了fromFlux函數的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('the last value returned does not depend on the ordering of tables in response', () => {
const respA = `#group,false,false,false,false
#datatype,string,long,dateTime:RFC3339,long
#default,1,,,
,result,table,_time,_value
,,0,2018-12-10T18:29:48Z,1
,,0,2018-12-10T18:54:18Z,2
#group,false,false,false,false
#datatype,string,long,dateTime:RFC3339,long
#default,1,,,
,result,table,_time,_value
,,1,2018-12-10T18:29:48Z,3
,,1,2018-12-10T18:40:18Z,4`
const respB = `#group,false,false,false,false
#datatype,string,long,dateTime:RFC3339,long
#default,1,,,
,result,table,_time,_value
,,0,2018-12-10T18:29:48Z,3
,,0,2018-12-10T18:40:18Z,4
#group,false,false,false,false
#datatype,string,long,dateTime:RFC3339,long
#default,1,,,
,result,table,_time,_value
,,1,2018-12-10T18:29:48Z,1
,,1,2018-12-10T18:54:18Z,2`
const latestValuesA = latestValues(fromFlux(respA).table)
const latestValuesB = latestValues(fromFlux(respB).table)
expect(latestValuesA).toEqual([2])
expect(latestValuesB).toEqual([2])
})