Skip to content

Commit

Permalink
Add system test to verify VELOCITAS_APP_MANIFEST
Browse files Browse the repository at this point in the history
  • Loading branch information
doosuu committed Aug 17, 2023
1 parent 46d8cc1 commit 05cab57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/system-test/exec.stest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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`);
});

Expand Down

0 comments on commit 05cab57

Please sign in to comment.