diff options
| author | 8cy <[email protected]> | 2020-04-03 02:48:28 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-03 02:48:28 -0700 |
| commit | f9159ea2d994e14180fb02ab562f0119513e67cf (patch) | |
| tree | 09d14cdf05456567156738b681379d4bccd64e5c /node_modules/http-response-object/test | |
| parent | 2020/04/03, 02:42, V1.2.1 (diff) | |
| download | s5nical-f9159ea2d994e14180fb02ab562f0119513e67cf.tar.xz s5nical-f9159ea2d994e14180fb02ab562f0119513e67cf.zip | |
2020/04/03, 02:47, V1.2.2
Diffstat (limited to 'node_modules/http-response-object/test')
| -rw-r--r-- | node_modules/http-response-object/test/index.js | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/node_modules/http-response-object/test/index.js b/node_modules/http-response-object/test/index.js deleted file mode 100644 index 0ff4e16..0000000 --- a/node_modules/http-response-object/test/index.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -var assert = require('assert'); -var Response = require('../'); - -var res = new Response(200, { - 'Foo-Bar': 'baz-Bosh', - 'bar-foo': 'bish-Bosh' -}, 'foo bar baz', 'http://example.com'); -assert(res.statusCode = 200); -assert(res.headers['foo-bar'] === 'baz-Bosh'); -assert(res.headers['bar-foo'] === 'bish-Bosh'); -assert(res.body === 'foo bar baz'); -assert(res.url === 'http://example.com'); -assert(res.getBody() === 'foo bar baz'); - -res = new Response(404, { - 'Foo-Bar': 'baz-Bosh' -}, 'Could not find page', 'http://example.com'); -assert(res.statusCode = 404); -assert(res.headers['foo-bar'] === 'baz-Bosh'); -assert(res.body === 'Could not find page'); -assert(res.url === 'http://example.com'); -var errored = false; -try { - res.getBody(); -} catch (ex) { - assert(ex.statusCode === 404); - assert(ex.headers['foo-bar'] === 'baz-Bosh'); - assert(ex.body === 'Could not find page'); - assert(ex.url === 'http://example.com'); - errored = true; -} -if (!errored) { - throw new Error('res.getBody() should throw an error when the status code is 404'); -} -console.log('tests passed'); |