diff --git a/src/platform/common/utils.ts b/src/platform/common/utils.ts index 78c35c67093..d12556a1715 100644 --- a/src/platform/common/utils.ts +++ b/src/platform/common/utils.ts @@ -476,9 +476,14 @@ export function useCustomMetadata() { if (ext && typeof ext.exports.dropCustomMetadata === 'boolean') { return ext.exports.dropCustomMetadata ? false : true; } - // Means ipynb extension has not yet been activated. - // Does not matter, we can just check the setting. - return !workspace.getConfiguration('jupyter', undefined).get('experimental.dropCustomMetadata', false); + try { + // Means ipynb extension has not yet been activated. + // Does not matter, we can just check the setting. + return !workspace.getConfiguration('jupyter', undefined).get('experimental.dropCustomMetadata', false); + } catch { + // This happens in unit tests, in this case just return `true`. + return true; + } } export async function activateIPynbExtension() {