Files
harbor-net/test/build/test-artifacts.test.js
dokril 34d8b681ad
Build and Deploy Gateway / build-and-push (push) Failing after 2s
Build and Deploy Gateway / deploy (push) Has been skipped
Refactor VPN proxy client implementation
2026-08-09 00:41:52 +03:00

21 lines
802 B
JavaScript

import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import test from 'node:test';
const root = path.resolve(import.meta.dirname, '../..');
test('test emit removes stale compiled artifacts before TypeScript runs', (t) => {
const directory = fs.mkdtempSync(path.join(os.tmpdir(), 'harbor-test-emit-'));
const output = path.join(directory, '.test-dist');
t.after(() => fs.rmSync(directory, { recursive: true, force: true }));
fs.mkdirSync(output);
fs.writeFileSync(path.join(output, 'removed-module.js'), 'stale');
execFileSync(process.execPath, [path.join(root, 'scripts/clean-test-dist.mjs')], { cwd: directory });
assert.equal(fs.existsSync(output), false);
});