diff --git a/scan/__tests__/main.test.ts b/scan/__tests__/main.test.ts index 43880951..7d7039f1 100644 --- a/scan/__tests__/main.test.ts +++ b/scan/__tests__/main.test.ts @@ -6,7 +6,8 @@ import { getQodanaScanArgs, Inputs, getQodanaUrl, - getQodanaArchiveName + getQodanaArchiveName, + VERSION } from '../../common/qodana' import * as fs from 'fs' @@ -128,3 +129,19 @@ test('download all Qodana CLI archives and check their checksums', async () => { } } }) + +test('check whether Azure Pipelines task.json definitions is up to date', () => { + const taskJson = JSON.parse( + fs.readFileSync(path.join(__dirname, '..', '..', 'vsts', 'QodanaScan', 'task.json'), 'utf8') + ) + expect(`${taskJson.version.Major}.${taskJson.version.Minor}.${taskJson.version.Patch}`).toEqual(VERSION) +}) + +test('check whether action README.md contains the latest version mentioned everywhere', () => { + const readmeMd = fs.readFileSync(path.join(__dirname, '..', '..', 'README.md'), 'utf8') + const mentions = readmeMd.match(/uses: JetBrains\/qodana-action@v\d+\.\d+\.\d+/g) || [] + expect(mentions.length > 0).toEqual(true) + for (const mention of mentions??[]) { + expect(mention).toEqual(`uses: JetBrains/qodana-action@v${VERSION}`) + } +})