Skip to content

Commit

Permalink
Add test proving range restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jan 26, 2024
1 parent cd4d96d commit de11556
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ npx defrag
```

or debug with

```bash
DEBUG=defrag npx defrag
```


## Config

Example `.defragrc.yaml`
Expand Down
16 changes: 16 additions & 0 deletions src/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,22 @@ describe('getVersionForConfig', () => {
]),
).toBe('5.4.0-beta.1');
});

it('restricted to ~', () => {
const verify = withConfig(
c({
'write-as': 'pinned',
'update-range': {
'~': ['ember-data'],
'^': [],
},
}),
);

expect(
verify('ember-data', '^5.3.0', ['^4.12.5', '^5.4.0', '^5.3.0', '^5.3.1']),
).toBe('5.3.1');
});
});

describe('getNearest', () => {
Expand Down

0 comments on commit de11556

Please sign in to comment.