test: isolate main checkout verification

This commit is contained in:
chrnx committed 2026-08-12 23:33:14 -05:00
1 parent 8fb87bf221
commit dc2b771a77
3 files changed
+13 -1

No files matched your search

+11
View File
@@ -31,6 +31,16 @@ test('scripts activate chrnx and run Composer from the mapped theme', async () =
);
});
test('Jest discovers JavaScript tests only from the active checkout', async () => {
const pkg = JSON.parse(await readFile('package.json', 'utf8'));
assert.match(
pkg.scripts['test:js'],
/--modulePathIgnorePatterns='<rootDir>\/\.worktrees\/'/,
);
assert.equal(pkg.jest, undefined);
});
test('PHP quality tools enforce the CHRNX conventions and cannot pass an empty suite', async () => {
const phpcs = await readFile('phpcs.xml.dist', 'utf8');
const phpunit = await readFile('phpunit.xml.dist', 'utf8');
@@ -39,6 +49,7 @@ test('PHP quality tools enforce the CHRNX conventions and cannot pass an empty s
assert.match(phpcs, /<rule ref="WordPress-Extra"\/>/);
assert.match(phpcs, /name="text_domain"[^>]+value="chrnx"/);
assert.match(phpcs, /name="prefixes"[^>]+value="chrnx_"/);
assert.match(phpcs, /<exclude-pattern>\*\/\.worktrees\/\*<\/exclude-pattern>/);
assert.match(phpunit, /bootstrap="tests\/php\/bootstrap\.php"/);
assert.match(phpunit, /failOnEmptyTestSuite="true"/);
assert.match(phpunit, /<directory suffix="Test\.php">tests\/php<\/directory>/);