lightsoutAlpha

test-file-size

a test file over the test-file line cap

Deterministic checkadvisory by defaultbasetests

The argument

Test Files Have a Line Cap Too

Test files stay under ~400 lines. Arrangement earns tests more room than source gets, but a test file past the cap is almost never "thorough" — it is the boundary test of an under-graduated module, absorbing the contracts of every internal unit behind its one public file.

The fix is a reshape of the module, not of the test file:

  1. Give each internal unit the oversized file is really testing a direct test beside it, asserting on the unit itself. The unit may not be a file yet — a long schema or config object tested block by block is several contracts living in one file; split the source into its blocks first, then test each. (A direct test needs no promotion of the unit to public — see the module-boundary-testing rule.)
  2. Leave the boundary file only what the boundary owns — sequencing, short-circuits, which units run at all, ordering of the result.
  3. Then delete the boundary tests the move made redundant. A boundary test whose every claim is now pinned by a unit's direct test (or by another module's own test of the same renderer or parser) is duplicate coverage — deleting it is consolidation. What stays banned is deleting a claim that afterward lives nowhere.

One shape is different: a pipeline orchestrator whose internal units are already promoted and directly tested, whose oversized file is genuinely end-to-end scenarios of the orchestrator's own outcomes. There is no unit left to graduate — so there, and only there, split the scenario suite by named concern (runPipeline.supervisor.unit.test.ts, runPipeline.advisories.unit.test.ts), each file carrying one concern and its own fixtures.

Splitting a test file into unnamed halves, or deleting assertions to duck the cap, clears the finding and keeps the disease — neither is a fix.

The proof

failsubject.unit.test.ts
import { test, expect } from '@jest/globals';

test('case 0 holds its contract', () => {
	expect(0 + 1).toBe(1);
});

test('case 1 holds its contract', () => {
	expect(1 + 1).toBe(2);
});

test('case 2 holds its contract', () => {
	expect(2 + 1).toBe(3);
});

test('case 3 holds its contract', () => {
	expect(3 + 1).toBe(4);
});

test('case 4 holds its contract', () => {
	expect(4 + 1).toBe(5);
});

test('case 5 holds its contract', () => {
	expect(5 + 1).toBe(6);
});

test('case 6 holds its contract', () => {
	expect(6 + 1).toBe(7);
});

test('case 7 holds its contract', () => {
	expect(7 + 1).toBe(8);
});

test('case 8 holds its contract', () => {
	expect(8 + 1).toBe(9);
});

test('case 9 holds its contract', () => {
	expect(9 + 1).toBe(10);
});

test('case 10 holds its contract', () => {
	expect(10 + 1).toBe(11);
});

test('case 11 holds its contract', () => {
	expect(11 + 1).toBe(12);
});

test('case 12 holds its contract', () => {
	expect(12 + 1).toBe(13);
});

test('case 13 holds its contract', () => {
	expect(13 + 1).toBe(14);
});

test('case 14 holds its contract', () => {
	expect(14 + 1).toBe(15);
});

test('case 15 holds its contract', () => {
	expect(15 + 1).toBe(16);
});

test('case 16 holds its contract', () => {
	expect(16 + 1).toBe(17);
});

test('case 17 holds its contract', () => {
	expect(17 + 1).toBe(18);
});

test('case 18 holds its contract', () => {
	expect(18 + 1).toBe(19);
});

test('case 19 holds its contract', () => {
	expect(19 + 1).toBe(20);
});

test('case 20 holds its contract', () => {
	expect(20 + 1).toBe(21);
});

test('case 21 holds its contract', () => {
	expect(21 + 1).toBe(22);
});

test('case 22 holds its contract', () => {
	expect(22 + 1).toBe(23);
});

test('case 23 holds its contract', () => {
	expect(23 + 1).toBe(24);
});

test('case 24 holds its contract', () => {
	expect(24 + 1).toBe(25);
});

test('case 25 holds its contract', () => {
	expect(25 + 1).toBe(26);
});

test('case 26 holds its contract', () => {
	expect(26 + 1).toBe(27);
});

test('case 27 holds its contract', () => {
	expect(27 + 1).toBe(28);
});

test('case 28 holds its contract', () => {
	expect(28 + 1).toBe(29);
});

test('case 29 holds its contract', () => {
	expect(29 + 1).toBe(30);
});

test('case 30 holds its contract', () => {
	expect(30 + 1).toBe(31);
});

test('case 31 holds its contract', () => {
	expect(31 + 1).toBe(32);
});

test('case 32 holds its contract', () => {
	expect(32 + 1).toBe(33);
});

test('case 33 holds its contract', () => {
	expect(33 + 1).toBe(34);
});

test('case 34 holds its contract', () => {
	expect(34 + 1).toBe(35);
});

test('case 35 holds its contract', () => {
	expect(35 + 1).toBe(36);
});

test('case 36 holds its contract', () => {
	expect(36 + 1).toBe(37);
});

test('case 37 holds its contract', () => {
	expect(37 + 1).toBe(38);
});

test('case 38 holds its contract', () => {
	expect(38 + 1).toBe(39);
});

test('case 39 holds its contract', () => {
	expect(39 + 1).toBe(40);
});

test('case 40 holds its contract', () => {
	expect(40 + 1).toBe(41);
});

test('case 41 holds its contract', () => {
	expect(41 + 1).toBe(42);
});

test('case 42 holds its contract', () => {
	expect(42 + 1).toBe(43);
});

test('case 43 holds its contract', () => {
	expect(43 + 1).toBe(44);
});

test('case 44 holds its contract', () => {
	expect(44 + 1).toBe(45);
});

test('case 45 holds its contract', () => {
	expect(45 + 1).toBe(46);
});

test('case 46 holds its contract', () => {
	expect(46 + 1).toBe(47);
});

test('case 47 holds its contract', () => {
	expect(47 + 1).toBe(48);
});

test('case 48 holds its contract', () => {
	expect(48 + 1).toBe(49);
});

test('case 49 holds its contract', () => {
	expect(49 + 1).toBe(50);
});

test('case 50 holds its contract', () => {
	expect(50 + 1).toBe(51);
});

test('case 51 holds its contract', () => {
	expect(51 + 1).toBe(52);
});

test('case 52 holds its contract', () => {
	expect(52 + 1).toBe(53);
});

test('case 53 holds its contract', () => {
	expect(53 + 1).toBe(54);
});

test('case 54 holds its contract', () => {
	expect(54 + 1).toBe(55);
});

test('case 55 holds its contract', () => {
	expect(55 + 1).toBe(56);
});

test('case 56 holds its contract', () => {
	expect(56 + 1).toBe(57);
});

test('case 57 holds its contract', () => {
	expect(57 + 1).toBe(58);
});

test('case 58 holds its contract', () => {
	expect(58 + 1).toBe(59);
});

test('case 59 holds its contract', () => {
	expect(59 + 1).toBe(60);
});

test('case 60 holds its contract', () => {
	expect(60 + 1).toBe(61);
});

test('case 61 holds its contract', () => {
	expect(61 + 1).toBe(62);
});

test('case 62 holds its contract', () => {
	expect(62 + 1).toBe(63);
});

test('case 63 holds its contract', () => {
	expect(63 + 1).toBe(64);
});

test('case 64 holds its contract', () => {
	expect(64 + 1).toBe(65);
});

test('case 65 holds its contract', () => {
	expect(65 + 1).toBe(66);
});

test('case 66 holds its contract', () => {
	expect(66 + 1).toBe(67);
});

test('case 67 holds its contract', () => {
	expect(67 + 1).toBe(68);
});

test('case 68 holds its contract', () => {
	expect(68 + 1).toBe(69);
});

test('case 69 holds its contract', () => {
	expect(69 + 1).toBe(70);
});

test('case 70 holds its contract', () => {
	expect(70 + 1).toBe(71);
});

test('case 71 holds its contract', () => {
	expect(71 + 1).toBe(72);
});

test('case 72 holds its contract', () => {
	expect(72 + 1).toBe(73);
});

test('case 73 holds its contract', () => {
	expect(73 + 1).toBe(74);
});

test('case 74 holds its contract', () => {
	expect(74 + 1).toBe(75);
});

test('case 75 holds its contract', () => {
	expect(75 + 1).toBe(76);
});

test('case 76 holds its contract', () => {
	expect(76 + 1).toBe(77);
});

test('case 77 holds its contract', () => {
	expect(77 + 1).toBe(78);
});

test('case 78 holds its contract', () => {
	expect(78 + 1).toBe(79);
});

test('case 79 holds its contract', () => {
	expect(79 + 1).toBe(80);
});

test('case 80 holds its contract', () => {
	expect(80 + 1).toBe(81);
});

test('case 81 holds its contract', () => {
	expect(81 + 1).toBe(82);
});

test('case 82 holds its contract', () => {
	expect(82 + 1).toBe(83);
});

test('case 83 holds its contract', () => {
	expect(83 + 1).toBe(84);
});

test('case 84 holds its contract', () => {
	expect(84 + 1).toBe(85);
});

test('case 85 holds its contract', () => {
	expect(85 + 1).toBe(86);
});

test('case 86 holds its contract', () => {
	expect(86 + 1).toBe(87);
});

test('case 87 holds its contract', () => {
	expect(87 + 1).toBe(88);
});

test('case 88 holds its contract', () => {
	expect(88 + 1).toBe(89);
});

test('case 89 holds its contract', () => {
	expect(89 + 1).toBe(90);
});

test('case 90 holds its contract', () => {
	expect(90 + 1).toBe(91);
});

test('case 91 holds its contract', () => {
	expect(91 + 1).toBe(92);
});

test('case 92 holds its contract', () => {
	expect(92 + 1).toBe(93);
});

test('case 93 holds its contract', () => {
	expect(93 + 1).toBe(94);
});

test('case 94 holds its contract', () => {
	expect(94 + 1).toBe(95);
});

test('case 95 holds its contract', () => {
	expect(95 + 1).toBe(96);
});

test('case 96 holds its contract', () => {
	expect(96 + 1).toBe(97);
});

test('case 97 holds its contract', () => {
	expect(97 + 1).toBe(98);
});

test('case 98 holds its contract', () => {
	expect(98 + 1).toBe(99);
});

test('case 99 holds its contract', () => {
	expect(99 + 1).toBe(100);
});

test('case 100 holds its contract', () => {
	expect(100 + 1).toBe(101);
});

test('case 101 holds its contract', () => {
	expect(101 + 1).toBe(102);
});

test('case 102 holds its contract', () => {
	expect(102 + 1).toBe(103);
});

test('case 103 holds its contract', () => {
	expect(103 + 1).toBe(104);
});

test('case 104 holds its contract', () => {
	expect(104 + 1).toBe(105);
});

test('case 105 holds its contract', () => {
	expect(105 + 1).toBe(106);
});

test('case 106 holds its contract', () => {
	expect(106 + 1).toBe(107);
});

test('case 107 holds its contract', () => {
	expect(107 + 1).toBe(108);
});

test('case 108 holds its contract', () => {
	expect(108 + 1).toBe(109);
});

test('case 109 holds its contract', () => {
	expect(109 + 1).toBe(110);
});

test('case 110 holds its contract', () => {
	expect(110 + 1).toBe(111);
});

test('case 111 holds its contract', () => {
	expect(111 + 1).toBe(112);
});

test('case 112 holds its contract', () => {
	expect(112 + 1).toBe(113);
});

test('case 113 holds its contract', () => {
	expect(113 + 1).toBe(114);
});

test('case 114 holds its contract', () => {
	expect(114 + 1).toBe(115);
});

test('case 115 holds its contract', () => {
	expect(115 + 1).toBe(116);
});

test('case 116 holds its contract', () => {
	expect(116 + 1).toBe(117);
});

test('case 117 holds its contract', () => {
	expect(117 + 1).toBe(118);
});

test('case 118 holds its contract', () => {
	expect(118 + 1).toBe(119);
});

test('case 119 holds its contract', () => {
	expect(119 + 1).toBe(120);
});

test('case 120 holds its contract', () => {
	expect(120 + 1).toBe(121);
});

test('case 121 holds its contract', () => {
	expect(121 + 1).toBe(122);
});

test('case 122 holds its contract', () => {
	expect(122 + 1).toBe(123);
});

test('case 123 holds its contract', () => {
	expect(123 + 1).toBe(124);
});

test('case 124 holds its contract', () => {
	expect(124 + 1).toBe(125);
});

test('case 125 holds its contract', () => {
	expect(125 + 1).toBe(126);
});

test('case 126 holds its contract', () => {
	expect(126 + 1).toBe(127);
});

test('case 127 holds its contract', () => {
	expect(127 + 1).toBe(128);
});

test('case 128 holds its contract', () => {
	expect(128 + 1).toBe(129);
});

test('case 129 holds its contract', () => {
	expect(129 + 1).toBe(130);
});

test('case 130 holds its contract', () => {
	expect(130 + 1).toBe(131);
});

test('case 131 holds its contract', () => {
	expect(131 + 1).toBe(132);
});

test('case 132 holds its contract', () => {
	expect(132 + 1).toBe(133);
});

test('case 133 holds its contract', () => {
	expect(133 + 1).toBe(134);
});

test('case 134 holds its contract', () => {
	expect(134 + 1).toBe(135);
});
passsubject.unit.test.ts
import { test, expect } from '@jest/globals';

test('case 0 holds its contract', () => {
	expect(0 + 1).toBe(1);
});

test('case 1 holds its contract', () => {
	expect(1 + 1).toBe(2);
});

test('case 2 holds its contract', () => {
	expect(2 + 1).toBe(3);
});

test('case 3 holds its contract', () => {
	expect(3 + 1).toBe(4);
});

test('case 4 holds its contract', () => {
	expect(4 + 1).toBe(5);
});

test('case 5 holds its contract', () => {
	expect(5 + 1).toBe(6);
});

test('case 6 holds its contract', () => {
	expect(6 + 1).toBe(7);
});

test('case 7 holds its contract', () => {
	expect(7 + 1).toBe(8);
});

test('case 8 holds its contract', () => {
	expect(8 + 1).toBe(9);
});

Its numbers

The defaults the pack ships. A repo may set its own.

testFile
400
{
	"standards-checks": {
		"test-file-size": {
			"settings": {
				"testFile": 400
			}
		}
	}
}

Turn it down

Both lines go in your lightsout.config.json.

"standards-checks": { "test-file-size": "advisory" }
"standards-checks": { "test-file-size": "off" }