Skip to content

Commit fcaa621

Browse files
committed
test(client): adapt unit tests
1 parent c2e3f66 commit fcaa621

2 files changed

Lines changed: 5 additions & 38 deletions

File tree

apps/meteor/client/lib/absoluteUrl.https.spec.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

apps/meteor/client/lib/absoluteUrl.spec.ts

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,12 @@ describe('_relativeToSiteRootUrl', () => {
9696
});
9797
});
9898

99-
describe('module-level initialization', () => {
100-
const originalConfig = (globalThis as any).__meteor_runtime_config__;
101-
102-
afterEach(() => {
103-
if (originalConfig === undefined) {
104-
delete (globalThis as any).__meteor_runtime_config__;
105-
} else {
106-
(globalThis as any).__meteor_runtime_config__ = originalConfig;
107-
}
99+
describe('defaultOptions', () => {
100+
it('should initialize rootUrl from baseURI', () => {
101+
expect(absoluteUrl.defaultOptions.rootUrl).toBe('http://localhost:3000/');
108102
});
109103

110-
it('should set rootUrl from __meteor_runtime_config__.ROOT_URL when available', async () => {
111-
(globalThis as any).__meteor_runtime_config__ = { ROOT_URL: 'http://configured.example.com' };
112-
113-
let mod: typeof import('./absoluteUrl') | undefined;
114-
await jest.isolateModulesAsync(async () => {
115-
mod = await import('./absoluteUrl');
116-
});
117-
118-
expect(mod!.absoluteUrl.defaultOptions.rootUrl).toBe('http://configured.example.com');
104+
it('should initialize secure from window.isSecureContext', () => {
105+
expect(absoluteUrl.defaultOptions.secure).toBe(window.isSecureContext);
119106
});
120107
});

0 commit comments

Comments
 (0)