This repository has been archived on 2023-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
node-fetch-cache/test/tests.cjs

19 lines
525 B
JavaScript
Raw Normal View History

2021-07-09 18:36:43 +00:00
const assert = require('assert');
const fetch = require('../commonjs/wrapper.cjs');
const TWO_HUNDRED_URL = 'https://httpbin.org/status/200';
describe('Commonjs module tests', function() {
it('Can make a request', async function() {
const res = await fetch(TWO_HUNDRED_URL);
assert.strictEqual(res.status, 200);
});
it('Has expected properties', function() {
assert(typeof fetch === 'function');
assert(fetch.MemoryCache);
assert(fetch.FileSystemCache);
assert(fetch.fetchBuilder);
});
});