add shared tunes test

This commit is contained in:
Felix Roos 2022-11-03 16:18:29 +01:00
parent f829f35cfa
commit ed44f4ed0c
4 changed files with 6375 additions and 0 deletions

View file

@ -109,6 +109,10 @@ export const samples = async (sampleMap, baseUrl = sampleMap._base || '') => {
sampleMap = `https://raw.githubusercontent.com/${path}/strudel.json`;
}
const base = sampleMap.split('/').slice(0, -1).join('/');
if (typeof fetch === 'undefined') {
// skip fetch when in node / testing
return;
}
return fetch(sampleMap)
.then((res) => res.json())
.then((json) => samples(json, baseUrl || json._base || base))