mirror of
https://github.com/LamGC/wp-asciiplayer.git
synced 2026-11-26 20:55:48 +00:00
fix: update build dependencies and improve documentation
Build and WordPress integration / PHP 7.4 syntax and regression tests (push) Canceled after 0s
Build and WordPress integration / PHP 8.3 syntax and regression tests (push) Canceled after 0s
Build and WordPress integration / WordPress 6.3 / PHP 7.4 (push) Canceled after 0s
Build and WordPress integration / WordPress latest / PHP 8.2 (push) Canceled after 0s
Build and WordPress integration / PHP 7.4 syntax and regression tests (push) Canceled after 0s
Build and WordPress integration / PHP 8.3 syntax and regression tests (push) Canceled after 0s
Build and WordPress integration / WordPress 6.3 / PHP 7.4 (push) Canceled after 0s
Build and WordPress integration / WordPress latest / PHP 8.2 (push) Canceled after 0s
- Fix gettext-parser 9 compatibility and update Babel parser - Apply targeted dependency security fixes and align Node.js requirements - Add regression tests and document remaining dependency risks - Review bundled player dependencies and advisory reachability - Reformat English and Chinese READMEs and simplify wording - Remove plugin version descriptions from README files PR #39
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createRequire } from 'node:module';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const SimpleGit = require('simple-git');
|
||||
const requireFromGit = createRequire(require.resolve('simple-git'));
|
||||
const { vulnerabilityCheck } = requireFromGit('@simple-git/argv-parser');
|
||||
|
||||
test('wp-env CommonJS simple-git API remains callable with the scoped parser update', async () => {
|
||||
assert.equal(typeof SimpleGit, 'function');
|
||||
const git = SimpleGit({ baseDir: process.cwd() });
|
||||
assert.equal(await git.checkIsRepo(), true);
|
||||
assert.equal((await git.raw(['rev-parse', '--is-inside-work-tree'])).trim(), 'true');
|
||||
});
|
||||
|
||||
test('git argument parser rejects unsafe editor and configuration inputs without executing them', () => {
|
||||
assert.deepEqual(vulnerabilityCheck(['status'], {}), []);
|
||||
for (const [args, env, category] of [
|
||||
[['commit'], { VISUAL: 'untrusted-editor' }, 'allowUnsafeEditor'],
|
||||
[['-c', 'trailer.test.cmd=untrusted-command', 'log'], {}, 'allowUnsafeCommandBinaries'],
|
||||
[['-c', 'include.path=/untrusted/config', 'status'], {}, 'allowUnsafeInclude'],
|
||||
]) {
|
||||
assert.ok(vulnerabilityCheck(args, env).some((finding) => finding.category === category));
|
||||
}
|
||||
});
|
||||
|
||||
test('git argument parser accepts wp-env download command shapes', () => {
|
||||
// Validate parser inputs only; these commands are never executed by this test.
|
||||
for (const args of [
|
||||
['clone', 'https://github.com/WordPress/wordpress-develop.git', '/tmp/wp-example', '--depth', '1', '--filter', 'blob:none', '--no-checkout'],
|
||||
['fetch', 'origin', 'trunk', '--depth', '1'],
|
||||
['checkout', 'trunk'],
|
||||
['reset', '--hard', 'FETCH_HEAD'],
|
||||
['sparse-checkout', 'set', '--cone', 'tests/phpunit'],
|
||||
]) assert.deepEqual(vulnerabilityCheck(args, {}), []);
|
||||
});
|
||||
Reference in New Issue
Block a user