-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(plugin-swc): should verify the version correctly (#3364)
Co-authored-by: neverland <[email protected]>
- Loading branch information
1 parent
8b7195a
commit 51f1b1c
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { isVersionBeyond17 } from '../src/utils'; | ||
|
||
describe('isVersionBeyondReact17', () => { | ||
test('should return true for version 17 and above', () => { | ||
expect(isVersionBeyond17('17.0.0')).toBe(true); | ||
expect(isVersionBeyond17('17.0.1')).toBe(true); | ||
expect(isVersionBeyond17('17.0.1-canary')).toBe(true); | ||
expect(isVersionBeyond17('^17.0.0')).toBe(true); | ||
expect(isVersionBeyond17('~18.2.0')).toBe(true); | ||
expect(isVersionBeyond17('18.3.0-canary')).toBe(true); | ||
}); | ||
|
||
test('should return false for below version 17', () => { | ||
expect(isVersionBeyond17('16.14.0')).toBe(false); | ||
expect(isVersionBeyond17('16.8.0-alpha-1')).toBe(false); | ||
expect(isVersionBeyond17('^16.0.0')).toBe(false); | ||
expect(isVersionBeyond17('~15.0.0')).toBe(false); | ||
}); | ||
}); |