Skip to content

Commit 379802d

Browse files
committed
fix tests
1 parent b932b60 commit 379802d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

scripts/map-files-to-urls.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
import { getUrlFromFilePath } from './utils/file-path/url/index.mjs'
7+
import allDocsPathsJson from '../app/api/docsPathsAllVersions.json' with { type: 'json' }
78

89
const filePaths = process.argv.slice(2)
910

@@ -13,7 +14,7 @@ main(filePaths)
1314
function main(filePaths) {
1415
const result = filePaths.map((filePath) => {
1516
try {
16-
return getUrlFromFilePath(filePath)
17+
return getUrlFromFilePath(filePath, allDocsPathsJson)
1718
} catch (error) {
1819
console.error(error)
1920
}

scripts/utils/file-path/url/index.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import { getProductDirectoryFromFilePath } from '../product-directory/index.mjs'
77
import { getVersionFromFilePath } from '../version/index.mjs'
88
import { PRODUCT_CONFIG } from '../../../../app/utils/productConfig.mjs'
9-
import allDocsPathsJson from '../../../../app/api/docsPathsAllVersions.json' with { type: 'json' }
10-
119
/**
1210
* Extracts the repo name from the file path,
1311
* then finds its respective url value from the docs paths
@@ -20,7 +18,7 @@ import allDocsPathsJson from '../../../../app/api/docsPathsAllVersions.json' wit
2018
*/
2119
export function getUrlFromFilePath(
2220
filePath,
23-
allDocsPaths = allDocsPathsJson,
21+
allDocsPaths,
2422
productConfig = PRODUCT_CONFIG,
2523
) {
2624
const repoDir = getProductDirectoryFromFilePath(filePath)

0 commit comments

Comments
 (0)