From 723591f55ac61032593eb1858c8c9f842baaa8e3 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sat, 7 Dec 2024 19:36:52 +0800 Subject: [PATCH] f --- test/urllib.options.allowH2.test.ts | 13 +++++++++++++ ...urllib.options.rejectUnauthorized-false.test.ts} | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 test/urllib.options.allowH2.test.ts rename test/{options.rejectUnauthorized-false.test.ts => urllib.options.rejectUnauthorized-false.test.ts} (96%) diff --git a/test/urllib.options.allowH2.test.ts b/test/urllib.options.allowH2.test.ts new file mode 100644 index 00000000..061c4241 --- /dev/null +++ b/test/urllib.options.allowH2.test.ts @@ -0,0 +1,13 @@ +import { strict as assert } from 'node:assert'; +import { describe, it } from 'vitest'; +import urllib from '../src/index.js'; + +describe('urllib.options.allowH2.test.ts', () => { + it('should 200 on options.allowH2 = true', async () => { + const response = await urllib.request('https://registry.npmmirror.com', { + allowH2: true, + dataType: 'json', + }); + assert.equal(response.status, 200); + }); +}); diff --git a/test/options.rejectUnauthorized-false.test.ts b/test/urllib.options.rejectUnauthorized-false.test.ts similarity index 96% rename from test/options.rejectUnauthorized-false.test.ts rename to test/urllib.options.rejectUnauthorized-false.test.ts index b1c81826..e5512403 100644 --- a/test/options.rejectUnauthorized-false.test.ts +++ b/test/urllib.options.rejectUnauthorized-false.test.ts @@ -6,7 +6,7 @@ import selfsigned from 'selfsigned'; import urllib, { HttpClient } from '../src/index.js'; import { startServer } from './fixtures/server.js'; -describe('options.rejectUnauthorized-false.test.ts', () => { +describe('urllib.options.rejectUnauthorized-false.test.ts', () => { let close: any; let _url: string; beforeAll(async () => {