From a8dc8dcdaeb00f88d96553a2e76eb8a93e1e5e13 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Tue, 1 Feb 2022 13:53:08 +0100 Subject: [PATCH] Tests --- test/index.test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/index.test.js b/test/index.test.js index 1067936050..ed4f72af90 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -2147,6 +2147,17 @@ describe('release-drafter', () => { } ) }) + it('gets the version from the tag, expands variables in it and forces using the tag', async () => { + return overridesTest( + { tag: 'v$RESOLVED_VERSION-beta' }, + { + body: `Placeholder with example. Automatically calculated values based on previous releases are next major=3.0.0, minor=2.1.0, patch=2.0.1. Manual input version is 2.1.1.`, + draft: true, + name: 'v2.1.1 (Code name: Placeholder)', + tag_name: 'v2.0.1-beta', + } + ) + }) }) describe('with just the name', () => { @@ -2161,6 +2172,17 @@ describe('release-drafter', () => { } ) }) + it('gets the version from the name, expands variables in it and forces using the name', async () => { + return overridesTest( + { name: 'v$RESOLVED_VERSION-beta (Code name: Foxtrot Unicorn)' }, + { + body: `Placeholder with example. Automatically calculated values based on previous releases are next major=3.0.0, minor=2.1.0, patch=2.0.1. Manual input version is 2.1.1.`, + draft: true, + name: 'v2.0.1-beta (Code name: Foxtrot Unicorn)', + tag_name: 'v2.1.1', + } + ) + }) }) describe('with publish: true', () => {