1import{j as s,a as e,gI as c,gN as f,gL as d,a4 as h,cM as i,gK as p,ag as v,gM as y,gP as x}from"./index-BFa3nKuT.js";import{a as b}from"./datepicker-CN3oO0F6.js";import"./visx-o561FtCw.js";import"./framerMotion-KnKeNhwd.js";import"./charts-BEfaN6Tb.js";import"./apollo-B9xYJgZj.js";import"./shiki-DSW_v8w1.js";import"./betterAuth-wecmey9t.js";import"./tanstack-82Oensom.js";import"./virtuoso-_8EeKo1c.js";import"./sentry-BM1d0HPc.js";import"./forms-BE_8TKCw.js";import"./amplitude-rTYtQKJT.js";import"./amplify-FijOe782.js";import"./qrcode-CMNUHY9J.js";import"./dnd-BjCurfON.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"01e610d75577dcaf5e5c9af84e79c9458f58a767"},t._sentryModuleMetadata=t._sentryModuleMetadata||{},t._sentryModuleMetadata[new t.Error().stack]=(function(a){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var l in r)r.hasOwnProperty(l)&&(a[l]=r[l])}return a})({},t._sentryModuleMetadata[new t.Error().stack],{"_sentryBundlerPluginAppKey:currents-dashboard":!0});var o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="cd9ae068-7a3d-49ff-bdc1-cbb1696b1e6b",t._sentryDebugIdIdentifier="sentry-dbid-cd9ae068-7a3d-49ff-bdc1-cbb1696b1e6b")}catch{}})();const N=t=>`Your task is to update Jest setup to report test results to Currents.dev 2 31. Install "@currents/jest" and "@currents/cmd" packages: 4 5- as development dependencies 6- using the project's package manager (npm, pnpm, yarn, etc...) 7 82. Configure Jest to use Currents reporter: 9 10 - Option A: Add to your Jest command: 11 12 \`\`\`bash 13 npx jest --reporters=@currents/jest --reporters=default 14 \`\`\` 15 16 - Option B: Add to your jest.config.js: 17 18 \`\`\`javascript 19 module.exports = { 20 reporters: ['default', '@currents/jest'], 21 }; 22 \`\`\` 23 243. Upload test results to Currents: 25 26 - After running tests, use the upload command with your credentials: 27 28 \`\`\`bash 29 npx currents upload --key=\${CURRENTS_RECORD_KEY} --project-id=${t} 30 \`\`\` 31 32Note: Keep your CURRENTS_RECORD_KEY private and use environment variables in CI. 33`,P=({aiMode:t,recordKey:o,projectId:a,apiUrl:n})=>{const[r,l]=b.useState(!1),u=(m=!1)=>{const g=m?o:x(o);return`${n?`CURRENTS_API_URL=${n} `:""}npx currents upload --key=${g} --project-id=${a}`};return s("div",{className:"space-y-ui-v2-4",children:[t&&s("div",{className:"flex flex-col gap-ui-v2-4",children:[s("span",{className:"text-sm flex items-center gap-2",children:[e(c,{step:1}),"Share those instructions with your AI assistant to have it update your Jest setup."]}),e("div",{className:"ml-8",children:e(f,{code:N(a),language:"markdown",filename:"Prompt",maxHeight:"max-h-[180px]",collapsible:!0,wrap:!0,children:e(d,{})})})]}),s("div",{className:"flex flex-col gap-8",children:[!t&&s(h,{children:[s("div",{className:"flex flex-col gap-ui-v2-4",children:[s("span",{className:"text-sm flex items-center gap-2",children:[e(c,{step:1}),s("span",{children:["Install ",e(i,{children:"@currents/jest"})," and"," ",e(i,{children:"@currents/cmd"})," npm packages."]})]}),e("div",{className:"ml-8",children:e(p,{code:"npm install @currents/jest @currents/cmd --save-dev",language:"bash",children:e(d,{})})})]}),s("div",{className:"flex flex-col gap-ui-v2-4",children:[s("span",{className:"text-sm flex items-center gap-2",children:[e(c,{step:2}),"Run the tests using the command below."]}),s("div",{className:"ml-8",children:[e(p,{code:"npx jest --reporters=@currents/jest --reporters=default",language:"bash",children:e(d,{})}),s("span",{className:"text-sm text-theme-secondary",children:["Keep using your current ",e(i,{children:"jest"})," command by adding Currents reporter to Jest configuration instead."," ",e(v,{color:!1,icon:!0,target:"_blank",href:"https://docs.currents.dev/resources/reporters/currents-jest#configuration",children:"Read more"}),"."]})]})]})]}),s("div",{className:"flex flex-col gap-ui-v2-4",children:[s("span",{className:"text-sm flex items-center gap-2",children:[e(c,{step:t?2:3}),"Upload test results to Currents."]}),e("div",{className:"ml-8",children:s(p,{code:u(r),copyValue:u(!0),language:"bash",children:[e(d,{}),e(y,{isRevealed:r,onToggle:()=>l(!r)})]})})]})]})]})};export{P as JestInstructions,P as default}; 34//# sourceMappingURL=jestInstructions-JnPL1AcC.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.