Skip to content

Commit

Permalink
fix(opentelemetry-sdk-trace-web): Remove broken test and replace with…
Browse files Browse the repository at this point in the history
… comment
  • Loading branch information
Grunet authored Apr 10, 2023
1 parent 91401af commit 4ecedce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion packages/opentelemetry-sdk-trace-web/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export function parseUrl(url: string): URLLike {
url,
typeof document !== 'undefined'
? document.baseURI
: typeof location !== 'undefined'
: typeof location !== 'undefined' // Some JS runtimes (e.g. Deno) don't define this
? location.href
: undefined
);
Expand Down
15 changes: 0 additions & 15 deletions packages/opentelemetry-sdk-trace-web/test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,21 +495,6 @@ describe('utils', () => {
assert.strictEqual(typeof url[field], 'string');
});
});

// Deno is an example of this
it('should parse url in runtimes where global location is not defined', () => {
const actualLocationObj = globalThis.location;
globalThis.location = undefined as any; // undefined is not allowed as a value normally, hence the any

try {
const url = parseUrl('https://opentelemetry.io/foo');
urlFields.forEach(field => {
assert.strictEqual(typeof url[field], 'string');
});
} finally {
globalThis.location = actualLocationObj;
}
});
});

describe('normalizeUrl', () => {
Expand Down

0 comments on commit 4ecedce

Please sign in to comment.