summaryrefslogtreecommitdiff
path: root/node_modules/http-basic/test
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-03 02:48:28 -0700
committer8cy <[email protected]>2020-04-03 02:48:28 -0700
commitf9159ea2d994e14180fb02ab562f0119513e67cf (patch)
tree09d14cdf05456567156738b681379d4bccd64e5c /node_modules/http-basic/test
parent2020/04/03, 02:42, V1.2.1 (diff)
downloads5nical-f9159ea2d994e14180fb02ab562f0119513e67cf.tar.xz
s5nical-f9159ea2d994e14180fb02ab562f0119513e67cf.zip
2020/04/03, 02:47, V1.2.2
Diffstat (limited to 'node_modules/http-basic/test')
-rw-r--r--node_modules/http-basic/test/gzip.js10
-rw-r--r--node_modules/http-basic/test/index.js89
2 files changed, 0 insertions, 99 deletions
diff --git a/node_modules/http-basic/test/gzip.js b/node_modules/http-basic/test/gzip.js
deleted file mode 100644
index 086f23c..0000000
--- a/node_modules/http-basic/test/gzip.js
+++ /dev/null
@@ -1,10 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var request = require('../');
-
-request('GET', 'https://www.yahoo.com', {cache: 'file', followRedirects: true, gzip: true}, function (err, res) {
- if (err) throw err;
- assert(res.statusCode === 200);
- res.body.pipe(process.stdout);
-});
diff --git a/node_modules/http-basic/test/index.js b/node_modules/http-basic/test/index.js
deleted file mode 100644
index d5c8242..0000000
--- a/node_modules/http-basic/test/index.js
+++ /dev/null
@@ -1,89 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var request = require('../');
-
-request('GET', 'http://example.com', function (err, res) {
- if (err) throw err;
-
- console.log('response A');
- assert(res.statusCode === 200);
- res.body.resume();
-});
-
-request('GET', 'http://example.com:80', function (err, res) {
- if (err) throw err;
-
- console.log('response A1');
- assert(res.statusCode === 200);
- res.body.resume();
-});
-
-
-request('GET', 'https://www.promisejs.org', function (err, res) {
- if (err) throw err;
-
- console.log('response B');
- assert(res.statusCode === 200);
- res.body.resume();
-});
-
-request('GET', 'https://promisejs.org', {followRedirects: true}, function (err, res) {
- if (err) throw err;
-
- console.log('response C');
- assert(res.statusCode === 200);
- res.body.resume();
-});
-
-var CACHED = 'https://www.promisejs.org/polyfills/promise-done-1.0.0.js';
-
-request('GET', CACHED, {cache: 'memory'}, function (err, res) {
- if (err) throw err;
-
- console.log('response D (populate cache)');
- assert(res.statusCode === 200);
- res.body.on('data', function () {});
- res.body.on('end', function () {
- request('GET', CACHED, {cache: 'memory'}, function (err, res) {
- if (err) throw err;
-
- console.log('response E (from cache)');
- assert(res.fromCache === true);
- assert(res.fromNotModified === false);
- assert(res.statusCode === 200);
- res.body.resume();
- });
- });
-});
-
-
-
-request('GET', CACHED, {cache: 'file'}, function (err, res) {
- if (err) throw err;
-
- console.log('response G (populate file cache)');
- assert(res.statusCode === 200);
- res.body.on('data', function () {});
- res.body.on('end', function () {
- setTimeout(function () {
- request('GET', CACHED, {cache: 'file'}, function (err, res) {
- if (err) throw err;
-
- console.log('response H (from file cache)');
- assert(res.fromCache === true);
- assert(res.fromNotModified === false);
- assert(res.statusCode === 200);
- res.body.resume();
- });
- }, 1000);
- });
-});
-
-request('GET', 'https://api.github.com/repos/isaacs/npm', {allowRedirectHeaders: ['User-Agent'], followRedirects: true, headers: {'User-Agent': 'http-basic'}}, function (err, res) {
- if (err) throw err;
-
- console.log('response I');
- assert(res.statusCode === 200);
- res.body.resume();
-}); \ No newline at end of file