#heft 4 articles
- A deleted or moved test keeps running from stale lib-commonjs — the SPFx rig's --clean never touches that foldergotchas / spfxIn SPFx projects built with Heft, Jest runs the compiled tests in lib-commonjs, but the rig's clean step deletes dist, lib, release, generated .scss.ts/.resx.ts files and parts of temp (and jest-output for the test…
- A test that runs under a different command than your release guards nothinggotchas / spfxheft build runs no Jest and the two prebuild scripts drift, so a rule can look covered while never executing on the release path
- In a Heft/SPFx project jest.mock() doesn't hoist — and sp-http drags in a missing MS-internal modulegotchas / spfxTests run over pre-compiled lib-commonjs without Babel, so a mock written below the imports lands after require; write it above the imports or use moduleNameMapper (and why only some sp-http suites die on…
- Jest's 5-second default timeout fails render tests under load, and the timed-out test breaks the next onegotchas / toolingThe first jsdom + React test of a suite pays for the cold module load; on a busy build machine it passes 5 s, Jest abandons it while its async render keeps running, and the following test fails with "button not found"…