Initial Commit

This commit is contained in:
plane000
2018-05-19 22:38:38 +01:00
parent 0e7fb409cf
commit 5ad3eacfce
283 changed files with 37470 additions and 0 deletions

26
node_modules/snekfetch/test/node/main.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
const fs = require('fs');
const { Snekfetch, TestRoot } = require('../interop');
require('../main');
test('node/pipe get', (done) => {
Snekfetch.get(`${TestRoot}/get`)
.pipe(fs.createWriteStream('/dev/null'))
.on('finish', done);
});
test('node/FormData json works', () =>
Snekfetch.post(`${TestRoot}/post`)
.attach('object', { a: 1 })
.then((res) => {
const { form } = res.body;
expect(form.object).toBe('{"a":1}');
})
);
test('node/rawsend post', () =>
Snekfetch.post(`${TestRoot}/post`)
.send(Buffer.from('memes')).end()
);