Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(test): prefer forEach instead of map #556

Merged
merged 2 commits into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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