文件操作 - functions.test.ts
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/plugins/datasource/cloud-monitoring/functions.test.ts
编辑文件内容
import { getAlignmentOptionsByMetric } from './functions'; import { ValueTypes, MetricKind } from './constants'; describe('functions', () => { let result: any; describe('getAlignmentOptionsByMetric', () => { describe('when double and gauge is passed', () => { beforeEach(() => { result = getAlignmentOptionsByMetric(ValueTypes.DOUBLE, MetricKind.GAUGE); }); it('should return all alignment options except two', () => { expect(result.length).toBe(9); expect(result.map((o: any) => o.value)).toEqual( expect.not.arrayContaining(['REDUCE_COUNT_TRUE', 'REDUCE_COUNT_FALSE']) ); }); }); describe('when double and delta is passed', () => { beforeEach(() => { result = getAlignmentOptionsByMetric(ValueTypes.DOUBLE, MetricKind.DELTA); }); it('should return all alignment options except four', () => { expect(result.length).toBe(9); expect(result.map((o: any) => o.value)).toEqual( expect.not.arrayContaining([ 'ALIGN_COUNT_TRUE', 'ALIGN_COUNT_FALSE', 'ALIGN_FRACTION_TRUE', 'ALIGN_INTERPOLATE', ]) ); }); }); }); });
修改文件时间
将文件时间修改为当前时间的前一年
删除文件