Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Modernize and convert some test in main.js to async/await #1456

Merged
merged 6 commits into from Jan 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/main.js
Expand Up @@ -222,6 +222,18 @@ describe('node-fetch', () => {
const json = await res.json();
expect(json.headers.host).to.equal('example.com');
});

jimmywarting marked this conversation as resolved.
Show resolved Hide resolved
it('should accept custom HoSt header', async () => {
const url = `${base}inspect`;
const options = {
headers: {
HoSt: 'example.com'
}
};
const res = await fetch(url, options);
const json = await res.json();
expect(json.headers.host).to.equal('example.com');
});

it('should follow redirect code 301', async () => {
const url = `${base}redirect/301`;
Expand Down