mirror of
https://github.com/bcomnes/deploy-to-neocities.git
synced 2026-01-17 15:06:29 +00:00
19 lines
431 B
JavaScript
19 lines
431 B
JavaScript
import tape from 'tape';
|
|
import ptape from 'tape-promise';
|
|
import { handleResponse } from './main';
|
|
import fetch from 'node-fetch';
|
|
const test = ptape(tape);
|
|
|
|
test('handleResponse', async t => {
|
|
return fetch('https://api.github.com/users/bcomnes/repos')
|
|
.then(response => {
|
|
t.ok(response.ok);
|
|
return response;
|
|
})
|
|
.then(handleResponse)
|
|
.then(json => {
|
|
t.ok(json);
|
|
})
|
|
.catch(t.error);
|
|
});
|