From ae053e2298ab1f9195529cbc8c867f7e653c8e33 Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Mon, 28 Nov 2016 13:22:35 +0900 Subject: [PATCH] Add test for headers change --- axios/axios-tests.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/axios/axios-tests.ts b/axios/axios-tests.ts index a321e97f19..eb98e2710c 100644 --- a/axios/axios-tests.ts +++ b/axios/axios-tests.ts @@ -80,7 +80,11 @@ var axiosInstance = axios.create({ timeout: 1000 }); -axiosInstance.request({url: "issues/1"}); +axiosInstance.request({url: "issues/1"}).then(res => { + if (res.headers['content-type'].startsWith('application/json')) { + throw new Error('Unexpected content-type'); + } +}); axios.all([getRepoDetails, getRepoDetails]).then(([repo1, repo2]) => { var sumIds = repo1.data.id + repo2.data.id;