Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion packages/deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"lint:fix": "oxlint . --fix --type-aware",
"lint:es-compatibility": "es-check es2022 ./build/esm/*.js --module",
"install:deno": "node ./scripts/install-deno.mjs",
"test": "run-s install:deno deno-types test:unit",
"test": "run-s install:deno deno-types test:types test:unit",
"test:types": "deno check --unstable-sloppy-imports test",
"test:unit": "deno test --allow-net --allow-read --allow-run --allow-env --no-check",
"test:unit:update": "deno test --allow-net --allow-read --allow-run --allow-env --no-check --allow-write -- --update",
"yalc:publish": "yalc publish --push --sig"
Expand Down
2 changes: 1 addition & 1 deletion packages/deno/test/deno-runtime-metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function collectMetrics(
await client.flush(2000);

// Stop the collection interval so Deno's leak detector doesn't flag it.
metricsIntegration.teardown?.();
(metricsIntegration as { teardown?: () => void }).teardown?.();

const items: MetricItem[] = [];
for (const envelope of envelopes) {
Expand Down
5 changes: 3 additions & 2 deletions packages/deno/test/opentelemetry.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getMainCarrier } from '@sentry/core';
import { assertEquals, assertNotEquals } from 'https://deno.land/std@0.212.0/assert/mod.ts';
import type { TracerProvider } from 'npm:@opentelemetry/api@1';
import { context, propagation, trace } from 'npm:@opentelemetry/api@1';
import type { DenoClient } from '../build/esm/index.js';
import { init, startSpan } from '../build/esm/index.js';
Expand Down Expand Up @@ -149,8 +150,8 @@ Deno.test('should override pre-existing OTel provider with Sentry provider', asy
resetSdk();

// Simulate a pre-existing OTel registration (e.g. from Supabase Edge Runtime)
const fakeProvider = { getTracer: () => ({}) };
trace.setGlobalTracerProvider(fakeProvider as any);
const fakeProvider = { getTracer: () => ({}) } as unknown as TracerProvider;
trace.setGlobalTracerProvider(fakeProvider);

const transactionEvents: any[] = [];

Expand Down
7 changes: 4 additions & 3 deletions packages/deno/test/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import {
init as initSdk,
spanStreamingIntegration,
} from '../build/esm/index.js';
import type { DenoOptions } from '../build/esm/index.js';
import { assert } from 'https://deno.land/std@0.212.0/assert/assert.ts';
import { assertEquals } from 'https://deno.land/std@0.212.0/assert/assert_equals.ts';

function init(options) {
function init(options: DenoOptions) {
getCurrentScope().setClient(undefined);
return initSdk(options);
}
Expand Down Expand Up @@ -40,7 +41,7 @@ Deno.test("doesn't add spanStreamingIntegration if user added it manually", () =
});
const integrations = client.getOptions().integrations.filter(i => i.name === 'SpanStreaming');
assertEquals(integrations.length, 1);
assert(!integrations[0].isDefaultInstance);
assert(!(integrations[0] as { isDefaultInstance?: true }).isDefaultInstance);
});

Deno.test("doesn't add tracing integrations when tracing is disabled", () => {
Expand Down Expand Up @@ -73,7 +74,7 @@ Deno.test('getDefaultIntegrations gates the tracing set on the options it is giv
});

Deno.test("init doesn't write the computed default integrations back onto the options object", () => {
const options = { dsn: 'https://username@domain/123' };
const options: DenoOptions = { dsn: 'https://username@domain/123' };
init(options);
assertEquals('defaultIntegrations' in options, false);
options.tracesSampleRate = 1;
Expand Down
Loading