/
githubmirror
/
meteor
Обзор
Документация
Войти
/
githubmirror
/
meteor
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
devel
packages/fetch/tests/main.js
18 строк
492 B
Gabriel Grubba
testing thing
19 сен 2023, 21:30
19 сен 2023, 21:30
d056a26
Код
Авторство
О чём код?
import { Tinytest } from "meteor/tinytest"; Tinytest.add("fetch - sanity", function (test) { test.equal(typeof fetch, "function"); }); Tinytest.addAsync("fetch - asset", async function (test) { const url = Meteor.absoluteUrl("/packages/local-test_fetch/tests/asset.json") const { word, times } = await fetch(url).then((res) => { if (!res.ok) throw res; return res.json(); }).catch(console.error) test.equal(word, "oyez"); test.equal(times, 3); });