You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -47,8 +49,12 @@ export class PrefetchedDocumentLoader extends FetchDocumentLoader {
47
49
}
48
50
49
51
// Warn before doing a remote context lookup
52
+
consterrorMessage=`Detected remote context lookup for '${url}'${this.path ? ` in ${this.path}` : ''}. This may indicate a missing or invalid dependency, incorrect version number, or an invalid context URL.`;
53
+
if(!this.remoteContextLookups){
54
+
thrownewError(errorMessage);
55
+
}
50
56
if(this.logger){
51
-
this.logger.warn(`Detected remote context lookup for '${url}'${this.path ? ` in ${this.path}` : ''}. This may indicate a missing or invalid dependency, incorrect version number, or an invalid context URL.`);
.toThrow(`Detected remote context lookup for 'http://remote.org/context' in PATH. This may indicate a missing or invalid dependency, incorrect version number, or an invalid context URL.`);
82
+
});
83
+
84
+
it('for a non-prefetched context with a logger',async()=>{
.toThrow(`Detected remote context lookup for 'http://remote.org/context' in PATH. This may indicate a missing or invalid dependency, incorrect version number, or an invalid context URL.`);
95
+
});
96
+
97
+
it('for a non-prefetched context with a logger without path',async()=>{
.toThrow(`Detected remote context lookup for 'http://remote.org/context'. This may indicate a missing or invalid dependency, incorrect version number, or an invalid context URL.`);
107
+
});
108
+
109
+
it('for a non-prefetched context with remoteContextLookups: true',async()=>{
expect(logger.warn).toHaveBeenCalledWith(`Detected remote context lookup for 'http://remote.org/context' in PATH. This may indicate a missing or invalid dependency, incorrect version number, or an invalid context URL.`);
96
134
});
97
135
98
-
it('for a non-prefetched context with a logger without path',async()=>{
136
+
it('for a non-prefetched context with a logger without path with remoteContextLookups: true',async()=>{
0 commit comments