build: convert all release scripts to typescript (#44035)
* build: convert all release scripts to typescript * fix test imports * build: fix version bumper export * refactor: use as const * spec: fix bad type spec
This commit is contained in:
parent
7ebc427bf5
commit
61565465fd
22 changed files with 1072 additions and 736 deletions
|
@ -1,7 +1,6 @@
|
|||
import { expect } from 'chai';
|
||||
import { GitProcess, IGitExecutionOptions, IGitResult } from 'dugite';
|
||||
import { nextVersion } from '../script/release/version-bumper';
|
||||
import * as utils from '../script/release/version-utils';
|
||||
import * as sinon from 'sinon';
|
||||
import { ifdescribe } from './lib/spec-helpers';
|
||||
|
||||
|
@ -53,43 +52,6 @@ class GitFake {
|
|||
}
|
||||
|
||||
describe('version-bumper', () => {
|
||||
describe('makeVersion', () => {
|
||||
it('makes a version with a period delimiter', () => {
|
||||
const components = {
|
||||
major: 2,
|
||||
minor: 0,
|
||||
patch: 0
|
||||
};
|
||||
|
||||
const version = utils.makeVersion(components, '.');
|
||||
expect(version).to.equal('2.0.0');
|
||||
});
|
||||
|
||||
it('makes a version with a period delimiter and a partial pre', () => {
|
||||
const components = {
|
||||
major: 2,
|
||||
minor: 0,
|
||||
patch: 0,
|
||||
pre: ['nightly', 12345678]
|
||||
};
|
||||
|
||||
const version = utils.makeVersion(components, '.', utils.preType.PARTIAL);
|
||||
expect(version).to.equal('2.0.0.12345678');
|
||||
});
|
||||
|
||||
it('makes a version with a period delimiter and a full pre', () => {
|
||||
const components = {
|
||||
major: 2,
|
||||
minor: 0,
|
||||
patch: 0,
|
||||
pre: ['nightly', 12345678]
|
||||
};
|
||||
|
||||
const version = utils.makeVersion(components, '.', utils.preType.FULL);
|
||||
expect(version).to.equal('2.0.0-nightly.12345678');
|
||||
});
|
||||
});
|
||||
|
||||
ifdescribe(!(process.platform === 'linux' && process.arch.indexOf('arm') === 0) && process.platform !== 'darwin')('nextVersion', () => {
|
||||
describe('bump versions', () => {
|
||||
const nightlyPattern = /[0-9.]*(-nightly.(\d{4})(\d{2})(\d{2}))$/g;
|
||||
|
@ -183,6 +145,7 @@ describe('version-bumper', () => {
|
|||
it('throws on an invalid bump type', () => {
|
||||
const version = 'v2.0.0';
|
||||
return expect(
|
||||
// @ts-expect-error 'WRONG' is not a valid bump type
|
||||
nextVersion('WRONG', version)
|
||||
).to.be.rejectedWith('Invalid bump type.');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue