Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Nov 16, 2023
1 parent 5ae8bab commit add30c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/targets/__tests__/npm.test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import { parseVersion } from '../../utils/version';
import { getPublishTag, getLatestVersion } from '../npm';

function setNpmToken() {
process.env.NPM_TOKEN = 'test-token';
}

const defaultNpmConfig = {
useYarn: false,
token: 'xxx',
};

describe('getLatestVersion', () => {
beforeEach(() => {
setNpmToken();
});

it('returns undefined for unexisting checkPackageName', async () => {
const actual = await getLatestVersion(
'sentry-xx-this-does-not-exist',
Expand All @@ -35,10 +27,6 @@ describe('getLatestVersion', () => {
});

describe('getPublishTag', () => {
beforeEach(() => {
setNpmToken();
});

it('returns undefined without a checkPackageName', async () => {
const logger = {
warn: jest.fn(),
Expand Down
2 changes: 2 additions & 0 deletions src/targets/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ export async function getLatestVersion(
}
/**
* Get the tag to use for publishing to npm.
* If this returns `undefined`, we'll use the default behavior from NPM
* (which is to set the `latest` tag).
*/
export async function getPublishTag(
version: string,
Expand Down

0 comments on commit add30c7

Please sign in to comment.