Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl committed Nov 19, 2024
1 parent 2d649c5 commit fe6b8ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/server/src/lib/write-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,22 @@ export const writePackage = async (

// make sure publish user has permission to publish the package
// get the github repository from packument
if (!repo || !config.githubRepoName) {
if (!repo && !config.githubRepoName) {
console.info(
'failed to find repository in latest.repository or latest.permsRepo field.'
'failed to find repository in latest.repository or latest.permsRepo field or env variable GITHUB_REPO_NAME was not set'
);
const msg =
'In order to publish through wombat the latest version on npm must have a repository pointing to github';
return respondWithError(res, msg, 400);
}

let repoResp = null;
let repoName = repo.name ?? config.githubRepoName;
let repoName = config.githubRepoName ?? (repo as {name: string}).name;

Check failure on line 144 in packages/server/src/lib/write-package.ts

View workflow job for this annotation

GitHub Actions / test (12)

'repoName' is never reassigned. Use 'const' instead

Check failure on line 144 in packages/server/src/lib/write-package.ts

View workflow job for this annotation

GitHub Actions / test (14)

'repoName' is never reassigned. Use 'const' instead

Check failure on line 144 in packages/server/src/lib/write-package.ts

View workflow job for this annotation

GitHub Actions / test (16)

'repoName' is never reassigned. Use 'const' instead
try {
repoResp = await github.getRepo(repoName, user.token);
} catch (e) {
console.info('failed to get repo response for ' + (repoName) + ' ' + e);

Check failure on line 148 in packages/server/src/lib/write-package.ts

View workflow job for this annotation

GitHub Actions / test (12)

Replace `(repoName)` with `repoName`

Check failure on line 148 in packages/server/src/lib/write-package.ts

View workflow job for this annotation

GitHub Actions / test (14)

Replace `(repoName)` with `repoName`

Check failure on line 148 in packages/server/src/lib/write-package.ts

View workflow job for this annotation

GitHub Actions / test (16)

Replace `(repoName)` with `repoName`
const msg = `repository ${repo.url ?? config.githubRepoName} doesn't exist or ${user.name} doesn't have access.`;
const msg = `repository ${(repo as {url: string}).url ?? config.githubRepoName} doesn't exist or ${user.name} doesn't have access.`;

Check failure on line 149 in packages/server/src/lib/write-package.ts

View workflow job for this annotation

GitHub Actions / test (12)

Replace `(repo·as·{url:·string}).url·??·config.githubRepoName` with `⏎······(repo·as·{url:·string}).url·??·config.githubRepoName⏎····`

Check failure on line 149 in packages/server/src/lib/write-package.ts

View workflow job for this annotation

GitHub Actions / test (14)

Replace `(repo·as·{url:·string}).url·??·config.githubRepoName` with `⏎······(repo·as·{url:·string}).url·??·config.githubRepoName⏎····`

Check failure on line 149 in packages/server/src/lib/write-package.ts

View workflow job for this annotation

GitHub Actions / test (16)

Replace `(repo·as·{url:·string}).url·??·config.githubRepoName` with `⏎······(repo·as·{url:·string}).url·??·config.githubRepoName⏎····`
return respondWithError(res, msg, 400);
}

Expand Down

0 comments on commit fe6b8ac

Please sign in to comment.