Skip to content

Commit

Permalink
axios@0.25.0 was changed that not allowed empty string url there.
Browse files Browse the repository at this point in the history
it was caused that the relative url may not works correctly, such as baseURL=https://api.mch.weixin.qq.com/v3/ecommerce/applyments/ and url=
ref axios/axios#3791.
  • Loading branch information
TheNorthMemory committed Jan 18, 2022
1 parent 04fad83 commit 81c8cbe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/openapi/101.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,39 +48,39 @@ describe('OpenAPI Kick Start 101', () => {
describe('DELETE/GET/POST/PUT/PATCH the URI(`/`) resource with the default endpoints', () => {
it('delete the `root(/)` should got a `404` HTML page', async () => {
scope.delete('/').reply(404, mocks);
await instance.delete({ transformResponse: [] }).catch((resp) => {
await instance[`/`].delete({ transformResponse: [] }).catch((resp) => {
resp.response.status.should.be.eql(404);
resp.response.data.should.be.String().and.match(HTML_REGEXP_PATTERN);
});
});

it('get the `root(/)` should got a `404` HTML page', async () => {
scope.get('/').reply(404, mocks);
await instance.get({ transformResponse: [] }).catch((resp) => {
await instance[`/`].get({ transformResponse: [] }).catch((resp) => {
resp.response.status.should.be.eql(404);
resp.response.data.should.be.String().and.match(HTML_REGEXP_PATTERN);
});
});

it('post to the `root(/)` should got a `404` HTML page', async () => {
scope.post('/').reply(404, mocks);
await instance.post({ hello: 'wechatpay' }, { transformResponse: [] }).catch((resp) => {
await instance[`/`].post({ hello: 'wechatpay' }, { transformResponse: [] }).catch((resp) => {
resp.response.status.should.be.eql(404);
resp.response.data.should.be.String().and.match(HTML_REGEXP_PATTERN);
});
});

it('patch to the `root(/)` should got a `404` HTML page', async () => {
scope.patch('/').reply(404, mocks);
await instance.patch({ hello: 'wechatpay' }, { transformResponse: [] }).catch((resp) => {
await instance[`/`].patch({ hello: 'wechatpay' }, { transformResponse: [] }).catch((resp) => {
resp.response.status.should.be.eql(404);
resp.response.data.should.be.String().and.match(HTML_REGEXP_PATTERN);
});
});

it('put to the `root(/)` should got a `404` HTML page', async () => {
scope.put('/').reply(404, mocks);
await instance.put({ hello: 'wechatpay' }, { transformResponse: [] }).catch((resp) => {
await instance[`/`].put({ hello: 'wechatpay' }, { transformResponse: [] }).catch((resp) => {
resp.response.status.should.be.eql(404);
resp.response.data.should.be.String().and.match(HTML_REGEXP_PATTERN);
});
Expand Down

0 comments on commit 81c8cbe

Please sign in to comment.