readme and test update

This commit is contained in:
David Frank
2019-05-16 16:15:58 +08:00
parent 55bc814dc8
commit a8c43d37e4
2 changed files with 45 additions and 3 deletions
+10 -1
View File
@@ -68,7 +68,7 @@ test('Blob slice()', async t => {
t.is(await blob2.text(), data.slice(0, 1));
});
test('Blob works with node-fetch Response', async t => {
test('Blob works with node-fetch Response.blob()', async t => {
let data = 'a=1';
let type = 'text/plain';
let blob = new Blob([data], { type });
@@ -76,3 +76,12 @@ test('Blob works with node-fetch Response', async t => {
let blob2 = await res.blob();
t.is(await blob2.text(), data);
});
test('Blob works with node-fetch Response.text()', async t => {
let data = 'a=1';
let type = 'text/plain';
let blob = new Blob([data], { type });
let res = new Response(blob);
let text = await res.text();
t.is(text, data);
});