Skip to content

Commit

Permalink
fix(node|karma|cypress): Fix axios usage in older node versions (#1533)
Browse files Browse the repository at this point in the history
* Fix axios usage in older node versions
* Test with Node 14
  • Loading branch information
tombrunet authored Jul 6, 2023
1 parent 2c23a45 commit 94c1827
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [14.x, 18.x]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion accessibility-checker/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"author": "IBM Accessibility",
"license": "Apache-2.0",
"dependencies": {
"axios": "^0.27.2",
"axios": "^1.4.0",
"chromedriver": "*",
"deep-diff": "^1.0.2",
"exceljs": "^4.3.0",
Expand Down
5 changes: 3 additions & 2 deletions common/module/src/api-ext/Fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ export async function fetch_get(url: string) {
return await resp.json();
} else {
if (!axios) {
axios = import("axios");
axios = await import("axios");
}
const response = await axios.get(url);
return JSON.parse(await response.data);
const data = await response.data;
return data;
}
}

0 comments on commit 94c1827

Please sign in to comment.