Skip to content

Commit

Permalink
refactor(test): prefer forEach instead of map (open-telemetry#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatelmas authored and mayurkale22 committed Nov 21, 2019
1 parent b048bb9 commit df2cc43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/opentelemetry-plugin-grpc/test/grpc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function startServer(grpc: GrpcModule, proto: any) {
getError('Server Stream Method Error', call.request.num)
);
} else {
result.map(element => {
result.forEach(element => {
call.write(element);
});
}
Expand Down Expand Up @@ -550,15 +550,15 @@ describe('GrpcPlugin', () => {
});
});

methodList.map(method => {
methodList.forEach(method => {
describe(`Test automatic tracing for grpc remote method ${method.description}`, () => {
runTest(method, tracer);
});
});

methodList.map(method => {
methodList.forEach(method => {
describe(`Test error raising for grpc remote ${method.description}`, () => {
Object.keys(grpc.status).map((statusKey: string) => {
Object.keys(grpc.status).forEach((statusKey: string) => {
// tslint:disable-next-line:no-any
const errorCode = Number(grpc.status[statusKey as any]);
if (errorCode > grpc.status.OK) {
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-tracing/test/Span.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe('Span', () => {
it('should set an attribute', () => {
const span = new Span(tracer, name, spanContext, SpanKind.CLIENT);

['String', 'Number', 'Boolean'].map(attType => {
['String', 'Number', 'Boolean'].forEach(attType => {
span.setAttribute('testKey' + attType, 'testValue' + attType);
});
span.setAttribute('object', { foo: 'bar' });
Expand Down

0 comments on commit df2cc43

Please sign in to comment.