Fix Windows installer and build versioning
This commit is contained in:
@@ -8,13 +8,14 @@ const assert = require('node:assert/strict');
|
||||
const { makeTmpDir, rmrf } = require('./helpers');
|
||||
const { stampVersion } = require('../../scripts/stamp-version');
|
||||
|
||||
test('stampVersion updates package metadata without semver validation', () => {
|
||||
test('stampVersion splits build labels into package and build versions', () => {
|
||||
const root = makeTmpDir('stamp-version');
|
||||
try {
|
||||
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({
|
||||
name: 'stepforge',
|
||||
version: '0.1.0',
|
||||
private: true,
|
||||
buildVersion: '0.1.0',
|
||||
}, null, 2));
|
||||
|
||||
fs.writeFileSync(path.join(root, 'package-lock.json'), JSON.stringify({
|
||||
@@ -35,9 +36,10 @@ test('stampVersion updates package metadata without semver validation', () => {
|
||||
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|
||||
const lock = JSON.parse(fs.readFileSync(path.join(root, 'package-lock.json'), 'utf8'));
|
||||
|
||||
assert.equal(pkg.version, '0.3.2.1');
|
||||
assert.equal(lock.version, '0.3.2.1');
|
||||
assert.equal(lock.packages[''].version, '0.3.2.1');
|
||||
assert.equal(pkg.version, '0.3.2');
|
||||
assert.equal(pkg.buildVersion, '0.3.2.1');
|
||||
assert.equal(lock.version, '0.3.2');
|
||||
assert.equal(lock.packages[''].version, '0.3.2');
|
||||
} finally {
|
||||
rmrf(root);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user