From 2207b538904a3b4b2798b32ea3e1814fd17cc851 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 21 Apr 2022 13:27:58 +1000 Subject: [PATCH] add a test to make sure the targets in package.json are well formatted --- ts/test/session/unit/updater/updater_test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ts/test/session/unit/updater/updater_test.ts b/ts/test/session/unit/updater/updater_test.ts index 34511043a..1ac6c8a48 100644 --- a/ts/test/session/unit/updater/updater_test.ts +++ b/ts/test/session/unit/updater/updater_test.ts @@ -1,4 +1,20 @@ +import { readFileSync } from 'fs-extra'; +import { isEmpty } from 'lodash'; +import path from 'path'; + describe('Updater', () => { // tslint:disable-next-line: no-empty it.skip('isUpdateAvailable', () => {}); + + it('package.json target are correct', () => { + const content = readFileSync( + path.join(__dirname, '..', '..', '..', '..', '..', 'package.json') + ); + + if (!content || isEmpty(content) || !content.includes('"target": ["deb", "rpm", "freebsd"],')) { + throw new Error( + 'Content empty or does not contain the target on a single line. They have to be for the linux appImage build to pass.' + ); + } + }); });