Commit 3bcb6981 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Move `fetch-config` to `config`

parent 921bbff2
import getApiUrl from './config/get-api-url'; import getApiUrl from './get-api-url';
import hostConfig from './host-config'; import hostConfig from '../host-config';
import * as postMessageJsonRpc from './util/postmessage-json-rpc'; import * as postMessageJsonRpc from '../util/postmessage-json-rpc';
/** /**
* @typedef {import('../types/config').SidebarConfig} SidebarConfig * @typedef {import('../../types/config').SidebarConfig} SidebarConfig
* @typedef {import('../types/config').MergedConfig} MergedConfig * @typedef {import('../../types/config').MergedConfig} MergedConfig
*/ */
/** /**
......
import { fetchConfig, $imports } from '../fetch-config'; import { fetchConfig, $imports } from '../fetch-config';
describe('sidebar/fetch-config', () => { describe('sidebar/config/fetch-config', () => {
let fakeHostConfig; let fakeHostConfig;
let fakeJsonRpc; let fakeJsonRpc;
let fakeWindow; let fakeWindow;
...@@ -14,9 +14,9 @@ describe('sidebar/fetch-config', () => { ...@@ -14,9 +14,9 @@ describe('sidebar/fetch-config', () => {
}; };
fakeApiUrl = sinon.stub().returns('https://dev.hypothes.is/api/'); fakeApiUrl = sinon.stub().returns('https://dev.hypothes.is/api/');
$imports.$mock({ $imports.$mock({
'./host-config': fakeHostConfig, '../host-config': fakeHostConfig,
'./util/postmessage-json-rpc': fakeJsonRpc, '../util/postmessage-json-rpc': fakeJsonRpc,
'./config/get-api-url': fakeApiUrl, './get-api-url': fakeApiUrl,
}); });
// By default, embedder provides no custom config. // By default, embedder provides no custom config.
...@@ -39,7 +39,7 @@ describe('sidebar/fetch-config', () => { ...@@ -39,7 +39,7 @@ describe('sidebar/fetch-config', () => {
$imports.$restore(); $imports.$restore();
}); });
describe('fetchConfig', () => { describe('config/fetch-config', () => {
context('direct embed', () => { context('direct embed', () => {
// no `requestConfigFromFrame` variable // no `requestConfigFromFrame` variable
// //
......
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
} from './cross-origin-rpc.js'; } from './cross-origin-rpc.js';
import addAnalytics from './ga'; import addAnalytics from './ga';
import disableOpenerForExternalLinks from './util/disable-opener-for-external-links'; import disableOpenerForExternalLinks from './util/disable-opener-for-external-links';
import { fetchConfig } from './fetch-config'; import { fetchConfig } from './config/fetch-config';
import * as sentry from './util/sentry'; import * as sentry from './util/sentry';
// Read settings rendered into sidebar app HTML by service/extension. // Read settings rendered into sidebar app HTML by service/extension.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment