Skip to content

Commit

Permalink
test: add test changeOperator
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Apr 26, 2024
1 parent a41d632 commit e084b46
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"@pob/eslint-config-typescript": "55.2.1",
"@pob/rollup-esbuild": "1.0.1",
"@pob/root": "9.3.2",
"@types/semver": "7.5.6",
"@types/semver": "7.5.8",
"@types/semver-utils": "1.1.3",
"@vitest/coverage-v8": "1.5.2",
"eslint": "8.57.0",
Expand Down
7 changes: 7 additions & 0 deletions src/checks/checkSatisfiesVersionsFromDependency.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ describe(checkSatisfiesVersionsFromDependency.name, () => {
{ devDependencies: { expectedDep: '^1.0.1' } },
true,
],
[
'expects range version with existing version ; shouldHaveExactVersions = false ; with release',
'^1.0.1-beta',
{ devDependencies: { expectedDep: '^1.0.0' } },
{ devDependencies: { expectedDep: '^1.0.1-beta' } },
false,
],
])(
'should to fix when %s',
(
Expand Down
8 changes: 8 additions & 0 deletions src/utils/semverUtils.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { describe, expect, it } from 'vitest';
import { changeOperator } from './semverUtils';

describe('changeOperator', () => {
it('should change the operator', () => {
expect(changeOperator('^1.0.1-beta', '~')).toBe('~1.0.1-beta');
});
});
11 changes: 2 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1033,14 +1033,7 @@ __metadata:
languageName: node
linkType: hard

"@types/semver@npm:7.5.6":
version: 7.5.6
resolution: "@types/semver@npm:7.5.6"
checksum: 10/e77282b17f74354e17e771c0035cccb54b94cc53d0433fa7e9ba9d23fd5d7edcd14b6c8b7327d58bbd89e83b1c5eda71dfe408e06b929007e2b89586e9b63459
languageName: node
linkType: hard

"@types/semver@npm:^7.5.8":
"@types/semver@npm:7.5.8, @types/semver@npm:^7.5.8":
version: 7.5.8
resolution: "@types/semver@npm:7.5.8"
checksum: 10/3496808818ddb36deabfe4974fd343a78101fa242c4690044ccdc3b95dcf8785b494f5d628f2f47f38a702f8db9c53c67f47d7818f2be1b79f2efb09692e1178
Expand Down Expand Up @@ -1741,7 +1734,7 @@ __metadata:
"@pob/eslint-config-typescript": "npm:55.2.1"
"@pob/rollup-esbuild": "npm:1.0.1"
"@pob/root": "npm:9.3.2"
"@types/semver": "npm:7.5.6"
"@types/semver": "npm:7.5.8"
"@types/semver-utils": "npm:1.1.3"
"@vitest/coverage-v8": "npm:1.5.2"
chalk: "npm:^5.2.0"
Expand Down

0 comments on commit e084b46

Please sign in to comment.