Skip to content

Commit

Permalink
chore(openui5-snapshot-test): update test-updater (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
akudev authored Apr 24, 2024
1 parent 5d22c8e commit 73e0f29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { resolve } = require("path");
const { zipObject, map, union, flatMap } = require("lodash");
const { emptyDir } = require("fs-extra");
const fetch = require("node-fetch");

const { writeUrlToFile } = require("./write-url-to-file");
const { log } = require("./logger");
Expand All @@ -11,6 +10,7 @@ const { log } = require("./logger");
* @returns {Promise<Record<string, UI5Lib>>}
*/
async function getSapUI5LibsMeta(version) {
const fetch = (await import("node-fetch")).default;
const sapUI5Response = await fetch(
`https://unpkg.com/@sapui5/distribution-metadata@${version}/metadata.json`
);
Expand All @@ -27,6 +27,7 @@ async function getSapUI5LibsMeta(version) {
* @returns {Promise<string[]>}
*/
async function getOpenUI5PossibleLibNames() {
const fetch = (await import("node-fetch")).default;
const openUI5OrgResponse = await fetch(
`https://registry.npmjs.com/-/v1/search?text=scope:openui5&size=100`
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { writeFile } = require("fs-extra");
const fetch = require("node-fetch");
const { log, error } = require("./logger");

/**
Expand All @@ -8,6 +7,7 @@ const { log, error } = require("./logger");
* @returns {Promise<void>}
*/
async function writeUrlToFile(url, file) {
const fetch = (await import("node-fetch")).default;
log(`fetching: ${url}`);
const response = await fetch(url);
if (!response.ok) {
Expand Down

0 comments on commit 73e0f29

Please sign in to comment.