Skip to content

Commit

Permalink
Merge pull request #161 from AElfProject/feature/node-fetch-test
Browse files Browse the repository at this point in the history
fix: 🐛 sync, XMLHttp error
  • Loading branch information
hzz780 authored Jun 21, 2024
2 parents 645250e + 1c290a4 commit 5a61939
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Statements | Branches | Functions | Lines |
| --------------------------- | ----------------------- | ------------------------- | ----------------- |
| ![Statements](https://img.shields.io/badge/statements-50%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-36.91%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-46%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-51.31%25-red.svg?style=flat) |
| ![Statements](https://img.shields.io/badge/statements-97.78%25-brightgreen.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-95.76%25-brightgreen.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-98.59%25-brightgreen.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-97.8%25-brightgreen.svg?style=flat) |


## 1. Introduction
Expand Down
1 change: 1 addition & 0 deletions jest.browser.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ module.exports = {
'**/test/unit/util/httpProvider.browser-test.js',
// "**/?(*.)+(spec|test).[tj]s?(x)"
],
testTimeout: 20000,

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
Expand Down
2 changes: 2 additions & 0 deletions jest.node.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ module.exports = {
testMatch: [
'**/test/unit/**/?(*.)+(test).[jt]s?(x)',
'**/test/unit/util/httpProvider.node-test.js',
'**/test/unit/util/httpProvider.fetch.node-test.js',
],
testTimeout: 20000,

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
Expand Down
2 changes: 1 addition & 1 deletion src/util/httpProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export default class HttpProvider {
}

sendAsyncByXMLHttp(requestConfig) {
const request = new RequestLibrary();
const request = RequestLibraryXMLOnly ? new RequestLibraryXMLOnly() : new RequestLibrary();
request.withCredentials = false;
request.timeout = this.timeout;
this.requestSend(requestConfig, request, true);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/util/httpProvider.node-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('test httpProvider', () => {
request
);
const result = request.responseText;
expect(JSON.parse(result)).toEqual({
expect(JSON.parse(result)).toMatchObject({
Success: false,
TransactionFee: null,
ResourceFee: null,
Expand Down

0 comments on commit 5a61939

Please sign in to comment.