mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
19 lines
492 B
JavaScript
19 lines
492 B
JavaScript
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);
|
|
});
|