1"use strict";(globalThis.webpackChunkkotestdocs=globalThis.webpackChunkkotestdocs||[]).push([[1495],{35517(e,t,n){n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>d,frontMatter:()=>r,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"framework/fail_on_empty","title":"Fail On Empty Test Suite","description":"To ensure that a project always executes at least one test,","source":"@site/versioned_docs/version-6.2/framework/fail_on_empty.md","sourceDirName":"framework","slug":"/framework/fail-on-empty-test-suite.html","permalink":"/docs/framework/fail-on-empty-test-suite.html","draft":false,"unlisted":false,"editUrl":"https://github.com/kotest/kotest/blob/master/documentation/versioned_docs/version-6.2/framework/fail_on_empty.md","tags":[],"version":"6.2","frontMatter":{"id":"fail_on_empty","title":"Fail On Empty Test Suite","slug":"fail-on-empty-test-suite.html","sidebar_label":"Fail On Empty Test Suite"},"sidebar":"framework","previous":{"title":"Fail Fast","permalink":"/docs/framework/fail-fast.html"},"next":{"title":"Config Dump","permalink":"/docs/framework/config-dump.html"}}');var o=n(74848),i=n(28453);const r={id:"fail_on_empty",title:"Fail On Empty Test Suite",slug:"fail-on-empty-test-suite.html",sidebar_label:"Fail On Empty Test Suite"},a=void 0,l={},c=[];function m(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.p,{children:["To ensure that a project always executes at least one test,\nyou can enable ",(0,o.jsx)(t.code,{children:"failOnEmptyTestSuite"})," in ",(0,o.jsx)(t.a,{href:"/docs/framework/project-config.html",children:"project config"}),"."]}),"\n",(0,o.jsx)(t.p,{children:"If this is set to true and a module has no tests executed then the build will fail."}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-kotlin",children:"class ProjectConfig : AbstractProjectConfig() {\n override val failOnEmptyTestSuite = true\n}\n"})}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsxs)(t.p,{children:["A module is considered empty if no tests are ",(0,o.jsx)(t.em,{children:"executed"})," regardless of whether tests are defined. This is useful to\ncatch scenarios were tests are being filtered out erroneously, such as by environment specific settings."]})})]})}function d(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(m,{...e})}):m(e)}},28453(e,t,n){n.d(t,{R:()=>r,x:()=>a});var s=n(96540);const o={},i=s.createContext(o);function r(e){const t=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),s.createElement(i.Provider,{value:t},e.children)}}}]);
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.