Refactor VPN proxy client implementation
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user