Skip to content

Commit

Permalink
chore: test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Oct 26, 2024
1 parent ac287c4 commit f93a3a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/package-manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('package-manifest', () => {
b: '^2.0.0',
c: '~4.3.0',
d: 'workspace:^',
e: 'npm:a@^2.0.0',
e: 'npm:@a/abc@^2.0.0',
},
};
const validated = {
Expand All @@ -80,7 +80,7 @@ describe('package-manifest', () => {
b: '^2.0.0',
c: '~4.3.0',
d: 'workspace:^',
e: 'npm:a@^2.0.0',
e: 'npm:@a/abc@^2.0.0',
},
peerDependencies: {},
};
Expand Down Expand Up @@ -317,7 +317,9 @@ describe('package-manifest', () => {
name: 'foo',
version: '1.0.0',
peerDependencies: {
a: 12345,
a: 'npm:@foo',
b: 'npm:foo@',
c: '12345',
},
}),
);
Expand Down
4 changes: 3 additions & 1 deletion src/package-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ function isValidPackageManifestDependencyValue(
try {
const redirectedDependencyMatch = redirectedDependencyRegexp.exec(version);

if (!redirectedDependencyMatch || redirectedDependencyMatch.length < 3) {
/* istanbul ignore if */
if (!redirectedDependencyMatch) {
return false;
}

Expand All @@ -184,6 +185,7 @@ function isValidPackageManifestDependencyValue(
isValidPackageManifestVersionField(redirectedVersion)
);
} catch (e) {
/* istanbul ignore next */
return false;
}
}
Expand Down

0 comments on commit f93a3a4

Please sign in to comment.