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
`Loading ${url} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://kit.svelte.dev/docs/loading#input-fetch`
`Loading ${url} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://kit.svelte.dev/docs/loading#input-fetch`
test('using window.fetch causes a warning',async({ page, javaScriptEnabled })=>{
1509
-
constwarnings=[];
1509
+
if(javaScriptEnabled&&process.env.DEV){
1510
+
constwarnings=[];
1510
1511
1511
-
page.on('console',(msg)=>{
1512
-
if(msg.type()==='warning'){
1513
-
warnings.push(msg.text());
1514
-
}
1515
-
});
1512
+
page.on('console',(msg)=>{
1513
+
if(msg.type()==='warning'){
1514
+
warnings.push(msg.text());
1515
+
}
1516
+
});
1516
1517
1517
-
awaitpage.goto('/load/window-fetch');
1518
-
expect(awaitpage.textContent('h1')).toBe('42');
1518
+
awaitpage.goto('/load/window-fetch/incorrect');
1519
+
expect(awaitpage.textContent('h1')).toBe('42');
1519
1520
1520
-
if(javaScriptEnabled&&process.env.DEV){
1521
1521
expect(warnings).toContain(
1522
1522
'Loading http://localhost:3000/load/window-fetch/data.json using `window.fetch`. For best results, use the `fetch` that is passed to your `load` function: https://kit.svelte.dev/docs/loading#input-fetch'
1523
1523
);
1524
+
1525
+
warnings.length=0;
1526
+
1527
+
awaitpage.goto('/load/window-fetch/correct');
1528
+
expect(awaitpage.textContent('h1')).toBe('42');
1529
+
1530
+
expect(warnings).not.toContain(
1531
+
'Loading http://localhost:3000/load/window-fetch/data.json using `window.fetch`. For best results, use the `fetch` that is passed to your `load` function: https://kit.svelte.dev/docs/loading#input-fetch'
0 commit comments