Back to Plate

Barrelsby must ignore slow test files

docs/solutions/workflow-issues/2026-03-23-barrelsby-must-ignore-slow-test-files.md

53.0.51.4 KB
Original Source

Barrelsby must ignore slow test files

Problem

The repo now uses two explicit test lanes:

  • fast: *.spec.ts[x]
  • slow: *.slow.ts[x]

CI runs pnpm brl before check and fails the PR if barrel generation changes tracked package files.

After the slow-lane migration, pnpm brl started exporting *.slow files from package index barrels like:

ts
export * from './Plate.slow';
export * from './cleanDocx.slow';

That is pure garbage. Slow tests are not runtime exports.

Root cause

tooling/scripts/brl.sh already excluded spec files, but not slow files:

sh
common_excludes='.*__tests__.*|(.*(fixture|template|spec|internal).*)|(.*\.d\.ts$)'

So once tests were renamed from *.spec.* to *.slow.*, barrelsby treated them as normal source files and generated export lines for them.

Fix

Exclude slow the same way spec is excluded:

sh
common_excludes='.*__tests__.*|(.*(fixture|template|spec|slow|internal).*)|(.*\.d\.ts$)'

After that, rerunning pnpm brl removes the bogus export * from './*.slow' entries and CI stops failing on barrel drift.

Verification

These checks passed:

bash
pnpm brl
pnpm check

Prevention

When the repo adds a new test-file suffix, update barrel-generation exclusions in the same change.

If the naming model is:

  • runtime files
  • *.spec.*
  • *.slow.*

then barrel tooling must explicitly ignore both test suffixes, not just the old one.