-
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(maker-base): extract Windows-specific version normalization …
…to a method on the maker base class
- Loading branch information
Showing
3 changed files
with
33 additions
and
3 deletions.
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
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,22 @@ | ||
import { expect } from 'chai'; | ||
|
||
import MakerBase from '../src/Maker'; | ||
|
||
class MakerImpl extends MakerBase<{}> { | ||
name = 'test'; | ||
|
||
defaultPlatforms = []; | ||
} | ||
|
||
describe('normalizeWindowsVersion', () => { | ||
const maker = new MakerImpl({}, []); | ||
|
||
it('removes everything after the dash', () => { | ||
for (const version of ['1.0.0-alpha', '1.0.0-alpha.1', '1.0.0-0.3.7', '1.0.0-x.7.z.92']) { | ||
expect(maker.normalizeWindowsVersion(version)).to.equal('1.0.0.0'); | ||
} | ||
}); | ||
it('does not truncate the version when there is no dash', () => { | ||
expect(maker.normalizeWindowsVersion('2.0.0')).to.equal('2.0.0.0'); | ||
}); | ||
}); |