Hook
Warn Skipped Tests
Claude Code hook that flags an edit to a JavaScript or TypeScript test file when it adds .skip, .only, xit, xdescribe, fit or fdescribe.
1node -e "let d='';process.stdin.on('data',c=>d+=c).on('end',()=>{let j={};try{j=JSON.parse(d)||{}}catch(e){process.exit(0)}const i=j.tool_input||{};const q=String.fromCharCode(34),sq=String.fromCharCode(39),bs=String.fromCharCode(92),nl=String.fromCharCode(10);const f=String(i.file_path||'').split(bs).join('/');if(!/([.](test|spec)[.][cm]?[jt]sx?$|[/]__tests__[/])/.test(f))process.exit(0);const pat=/(^|[^A-Za-z0-9_.])(x(it|describe|test)|f(it|describe)|(it|test|describe|context)[.](skip|only))([.]|[(])/g;const n=s=>(String(s||'').match(pat)||[]).length;const edits=Array.isArray(i.edits)?i.edits:[i];const added=edits.reduce((s,e)=>s+Math.max(0,n(e.new_string!==undefined?e.new_string:e.content)-n(e.old_string)),0);if(added>0){console.error('Warning: '+f+' now holds '+added+' skipped or focused test(s) (.skip, .only, xit, fit). Turn them back on, or tell the user why they stay off.');process.exit(2)}})"
javascript
Warn Skipped Tests
Hookjavascript
Free