Merge pull request #243 from tidalcycles/shared-tests

snapshot tests on shared snippets
This commit is contained in:
Felix Roos 2022-11-06 11:05:23 +01:00 committed by GitHub
commit c3d6de2412
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 7002 additions and 1 deletions

View file

@ -113,6 +113,10 @@ export const samples = async (sampleMap, baseUrl = sampleMap._base || '') => {
return;
}
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))