mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
Made all lines less than 100 characters
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
|
||||
"import/prefer-default-export": 0,
|
||||
|
||||
|
||||
"import/no-extraneous-dependencies": 0,
|
||||
"jsx-a11y/no-static-element-interactions": 0,
|
||||
"jsx-a11y/label-has-for": 0,
|
||||
|
||||
@@ -34,7 +34,8 @@ describe('NodeDetails', () => {
|
||||
details = {label: 'Node 1'};
|
||||
const c = TestUtils.renderIntoDocument(
|
||||
<Provider store={configureStore()}>
|
||||
<NodeDetails nodes={nodes}
|
||||
<NodeDetails
|
||||
nodes={nodes}
|
||||
topologyId="containers"
|
||||
nodeId={nodeId} details={details}
|
||||
/>
|
||||
|
||||
@@ -149,8 +149,13 @@ export default ComposedComponent => class extends React.Component {
|
||||
.filter(dateFilter);
|
||||
|
||||
const lastValue = samples.length > 0 ? samples[samples.length - 1].value : null;
|
||||
const slidingWindow = {first: movingFirstDate,
|
||||
last: movingLastDate, max, samples, value: lastValue};
|
||||
const slidingWindow = {
|
||||
first: movingFirstDate,
|
||||
last: movingLastDate,
|
||||
value: lastValue,
|
||||
samples,
|
||||
max
|
||||
};
|
||||
|
||||
return <ComposedComponent {...this.props} {...slidingWindow} />;
|
||||
}
|
||||
|
||||
@@ -7,34 +7,42 @@ describe('ArrayUtils', () => {
|
||||
const f = ArrayUtils.uniformSelect;
|
||||
|
||||
it('it should select the array elements uniformly, including the endpoints', () => {
|
||||
expect(f(['x', 'y'], 3)).toEqual(['x', 'y']);
|
||||
expect(f(['x', 'y'], 2)).toEqual(['x', 'y']);
|
||||
{
|
||||
const arr = ['x', 'y'];
|
||||
expect(f(arr, 3)).toEqual(['x', 'y']);
|
||||
expect(f(arr, 2)).toEqual(['x', 'y']);
|
||||
}
|
||||
|
||||
expect(f(['A', 'B', 'C', 'D', 'E'], 6)).toEqual(['A', 'B', 'C', 'D', 'E']);
|
||||
expect(f(['A', 'B', 'C', 'D', 'E'], 5)).toEqual(['A', 'B', 'C', 'D', 'E']);
|
||||
expect(f(['A', 'B', 'C', 'D', 'E'], 4)).toEqual(['A', 'B', 'D', 'E']);
|
||||
expect(f(['A', 'B', 'C', 'D', 'E'], 3)).toEqual(['A', 'C', 'E']);
|
||||
expect(f(['A', 'B', 'C', 'D', 'E'], 2)).toEqual(['A', 'E']);
|
||||
{
|
||||
const arr = ['A', 'B', 'C', 'D', 'E'];
|
||||
expect(f(arr, 6)).toEqual(['A', 'B', 'C', 'D', 'E']);
|
||||
expect(f(arr, 5)).toEqual(['A', 'B', 'C', 'D', 'E']);
|
||||
expect(f(arr, 4)).toEqual(['A', 'B', 'D', 'E']);
|
||||
expect(f(arr, 3)).toEqual(['A', 'C', 'E']);
|
||||
expect(f(arr, 2)).toEqual(['A', 'E']);
|
||||
}
|
||||
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 12)).toEqual(
|
||||
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
|
||||
);
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 11)).toEqual(
|
||||
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 10)).toEqual([1, 2, 3, 4, 5, 7, 8, 9, 10, 11]
|
||||
);
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 9)).toEqual([1, 2, 3, 5, 6, 7, 9, 10, 11]);
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 8)).toEqual([1, 2, 4, 5, 7, 8, 10, 11]);
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 7)).toEqual([1, 2, 4, 6, 8, 10, 11]);
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 6)).toEqual([1, 3, 5, 7, 9, 11]);
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 5)).toEqual([1, 3, 6, 9, 11]);
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 4)).toEqual([1, 4, 8, 11]);
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 3)).toEqual([1, 6, 11]);
|
||||
expect(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], 2)).toEqual([1, 11]);
|
||||
{
|
||||
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
||||
expect(f(arr, 12)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
|
||||
expect(f(arr, 11)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
|
||||
expect(f(arr, 10)).toEqual([1, 2, 3, 4, 5, 7, 8, 9, 10, 11]);
|
||||
expect(f(arr, 9)).toEqual([1, 2, 3, 5, 6, 7, 9, 10, 11]);
|
||||
expect(f(arr, 8)).toEqual([1, 2, 4, 5, 7, 8, 10, 11]);
|
||||
expect(f(arr, 7)).toEqual([1, 2, 4, 6, 8, 10, 11]);
|
||||
expect(f(arr, 6)).toEqual([1, 3, 5, 7, 9, 11]);
|
||||
expect(f(arr, 5)).toEqual([1, 3, 6, 9, 11]);
|
||||
expect(f(arr, 4)).toEqual([1, 4, 8, 11]);
|
||||
expect(f(arr, 3)).toEqual([1, 6, 11]);
|
||||
expect(f(arr, 2)).toEqual([1, 11]);
|
||||
}
|
||||
|
||||
expect(f(_.range(1, 10001), 4)).toEqual([1, 3334, 6667, 10000]);
|
||||
expect(f(_.range(1, 10001), 3)).toEqual([1, 5000, 10000]);
|
||||
expect(f(_.range(1, 10001), 2)).toEqual([1, 10000]);
|
||||
{
|
||||
const arr = _.range(1, 10001);
|
||||
expect(f(arr, 4)).toEqual([1, 3334, 6667, 10000]);
|
||||
expect(f(arr, 3)).toEqual([1, 5000, 10000]);
|
||||
expect(f(arr, 2)).toEqual([1, 10000]);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -154,7 +154,7 @@ describe('SearchUtils', () => {
|
||||
const fun = SearchUtils.makeRegExp;
|
||||
|
||||
it('should make a regexp from any string', () => {
|
||||
expect(fun().source).toEqual((new RegExp).source);
|
||||
expect(fun().source).toEqual((new RegExp()).source);
|
||||
expect(fun('que').source).toEqual((new RegExp('que')).source);
|
||||
// invalid string
|
||||
expect(fun('que[').source).toEqual((new RegExp('que\\[')).source);
|
||||
|
||||
Reference in New Issue
Block a user