Files
Firelink/scripts/tauri-command.node-test.js
T
NimBold 725f5e40ec fix(build): isolate engine staging per invocation
- remove shared staging locks and the repository engine tree
- stage verified target payloads in private atomic workspaces
- fence Tauri bundles and process-tree cleanup across platforms
- align CI, AppImage packaging, smoke checks, and release docs
2026-08-31 01:11:56 +03:30

37 lines
1.4 KiB
JavaScript

import assert from 'node:assert/strict';
import { spawnSync } from 'node:child_process';
import path from 'node:path';
import test from 'node:test';
import { commandIsStandaloneBundle, commandUsesEngineTree } from './tauri-command.js';
test('Tauri engine-consuming commands use an engine workspace', () => {
assert.equal(commandUsesEngineTree(['dev']), true);
assert.equal(commandUsesEngineTree(['build', '--target', 'x86_64-unknown-linux-gnu']), true);
assert.equal(commandUsesEngineTree(['bundle', '--bundles', 'appimage']), true);
assert.equal(commandUsesEngineTree(['info']), false);
assert.equal(commandUsesEngineTree(['--help']), false);
});
test('standalone bundle commands prepare engines before Tauri starts', () => {
assert.equal(commandIsStandaloneBundle(['bundle', '--bundles', 'app']), true);
assert.equal(commandIsStandaloneBundle(['build', '--bundles', 'app']), false);
});
test('the bundle hook accepts a completed wrapper preflight', () => {
const result = spawnSync(
process.execPath,
[path.join(import.meta.dirname, 'before-tauri-bundle.js')],
{
cwd: path.join(import.meta.dirname, '..'),
env: {
...process.env,
FIRELINK_ENGINE_BUNDLE_PREPARED: '1',
FIRELINK_SKIP_ENGINE_RESOURCE: '',
FIRELINK_ENGINE_OUTPUT_ROOT: '',
},
stdio: 'pipe',
},
);
assert.equal(result.status, 0, result.stderr.toString());
});