Skip to content

Commit

Permalink
Cleanup assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
nachogiljaldo committed Aug 7, 2023
1 parent a525478 commit 45b6fba
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions plugins/node/opentelemetry-instrumentation-knex/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ describe('Knex instrumentation', () => {
parentSpan.end();

const instrumentationSpans = memoryExporter.getFinishedSpans();
const last = instrumentationSpans.pop() as any;
assertSpans(instrumentationSpans, [
{
statement: 'create table `testTable1` (`title` varchar(255))',
Expand All @@ -236,14 +235,8 @@ describe('Knex instrumentation', () => {
'select count(*) as `count` from (select * from `te..',
parentSpan,
},
null,
]);
assert.strictEqual(instrumentationSpans[0].name, ':memory:');
assert.strictEqual(
instrumentationSpans[1].name,
'insert :memory:.testTable1'
);

assert(last.name, 'parentSpan');
}
);
});
Expand Down Expand Up @@ -278,7 +271,6 @@ describe('Knex instrumentation', () => {
parentSpan.end();

const instrumentationSpans = memoryExporter.getFinishedSpans();
const last = instrumentationSpans.pop() as any;
assertSpans(instrumentationSpans, [
{
statement: 'create table `testTable1` (`title` varchar(255))',
Expand All @@ -297,14 +289,8 @@ describe('Knex instrumentation', () => {
'select count(*) as `count2` from (select count(*) ..',
parentSpan,
},
null,
]);
assert.strictEqual(instrumentationSpans[0].name, ':memory:');
assert.strictEqual(
instrumentationSpans[1].name,
'insert :memory:.testTable1'
);

assert(last.name, 'parentSpan');
}
);
});
Expand Down Expand Up @@ -343,7 +329,6 @@ describe('Knex instrumentation', () => {
parentSpan.end();

const instrumentationSpans = memoryExporter.getFinishedSpans();
const last = instrumentationSpans.pop() as any;
assertSpans(instrumentationSpans, [
{
statement: 'create table `testTable1` (`title` varchar(255))',
Expand Down Expand Up @@ -372,14 +357,8 @@ describe('Knex instrumentation', () => {
'select * from `testTable2` left join (select count..',
parentSpan,
},
null,
]);
assert.strictEqual(instrumentationSpans[0].name, ':memory:');
assert.strictEqual(
instrumentationSpans[1].name,
'insert :memory:.testTable1'
);

assert(last.name, 'parentSpan');
}
);
});
Expand Down Expand Up @@ -418,7 +397,6 @@ describe('Knex instrumentation', () => {
parentSpan.end();

const instrumentationSpans = memoryExporter.getFinishedSpans();
const last = instrumentationSpans.pop() as any;
assertSpans(instrumentationSpans, [
{
statement: 'create table `testTable1` (`title` varchar(255))',
Expand Down Expand Up @@ -447,14 +425,8 @@ describe('Knex instrumentation', () => {
'select * from (select count(*) as `count` from (se..',
parentSpan,
},
null,
]);
assert.strictEqual(instrumentationSpans[0].name, ':memory:');
assert.strictEqual(
instrumentationSpans[1].name,
'insert :memory:.testTable1'
);

assert(last.name, 'parentSpan');
}
);
});
Expand Down

0 comments on commit 45b6fba

Please sign in to comment.