From 05cab57f7f925fad670d6ccabb667338d49452a0 Mon Sep 17 00:00:00 2001 From: Dominic Sudy Date: Thu, 17 Aug 2023 09:50:29 +0200 Subject: [PATCH] Add system test to verify VELOCITAS_APP_MANIFEST --- test/system-test/exec.stest.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/system-test/exec.stest.ts b/test/system-test/exec.stest.ts index b0676c04..a4767bcd 100644 --- a/test/system-test/exec.stest.ts +++ b/test/system-test/exec.stest.ts @@ -20,6 +20,7 @@ import { join } from 'path'; import { cwd } from 'process'; import YAML from 'yaml'; import { DEFAULT_BUFFER_ENCODING } from '../../src/modules/constants'; +import { readFileSync } from 'fs'; const VELOCITAS_PROCESS = join('..', '..', process.env['VELOCITAS_PROCESS'] ? process.env['VELOCITAS_PROCESS'] : 'velocitas'); const TEST_ROOT = cwd(); @@ -51,10 +52,11 @@ describe('CLI command', () => { it('should pass environment variables to the spawned process', async () => { const result = spawnSync(VELOCITAS_PROCESS, ['exec', 'test-component', 'echo-env'], { encoding: DEFAULT_BUFFER_ENCODING }); + const expectedString = JSON.stringify(JSON.parse(readFileSync('./app/AppManifest.json', 'utf-8'))); expect(result.stdout).to.contain('VELOCITAS_WORKSPACE_DIR='); expect(result.stdout).to.contain('VELOCITAS_CACHE_DATA='); expect(result.stdout).to.contain('VELOCITAS_CACHE_DIR='); - expect(result.stdout).to.contain('VELOCITAS_APP_MANIFEST='); + expect(result.stdout).to.contain(`VELOCITAS_APP_MANIFEST=${expectedString}`); expect(result.stdout).to.contain(`VELOCITAS_PACKAGE_DIR=${VELOCITAS_HOME}/packages/test-package/test-version`); });