Skip to content

testCaseNonStaticCode

Test case code should be a static string literal.

✅ This rule is included in the flint logical presets.

Test case code values should be static string literals ('', "", or ` `). Dynamically generating test cases with variables, function calls, template interpolations, or spreads can make individual test cases harder to tweak, encourage catch-all tests, and make the tests difficult to statically analyze.

AEconsB0coAE <= sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">41<1"sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meec-li">53ruleTestAB0descri53(rule,< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53valid: [code<],d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53invalid: [<],d ivclassNa="meec-li">53}<);d ivclassNa="meco"><);d>53ruleTestAB0descri53(rule,< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53valid: [{ code<: sp ansty="le--0:#82AAFF;--1:#3B61">B0getCo53() }<],d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53invalid: [<],d ivclassNa="meec-li">53}<);d ivclassNa="meco"><);d>53ruleTestAB0descri53(rule,< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53valid: [{ code<: sp ansty="le--0:#D6DEEB;--1:#403F">5<3`sp ansty="le--0:#ECC48D;--1:#3B61">B<0asp ansty="le--0:#E2817F;--1:#B238">34<${sp ansty="le--0:#D6DEEB;--1:#403F">5<3bsp ansty="le--0:#E2817F;--1:#B238">3<4}sp ansty="le--0:#D6DEEB;--1:#403F">5<3`sp ansty="le--0:#D6DEEB;--1:#403F">53 }<],d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53invalid: [<],d ivclassNa="meec-li">53}<);d ivclassNa="meco"><);d>53ruleTestAB0descri53(rule,< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53valid: [<{ sp ansty="le--0:#7FDBCA;--1:#096E">72.<..sp ansty="le--0:#D6DEEB;--1:#403F">53baseCase }<],d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53invalid: [<],d ivclassNa="meec-li">53}<);d ivclassNa="meco"><);d>
3F53ruleTe4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B0desc3F53(rul3F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53vali1<111" spans="tyle--0:#ECC48D;--1:#98">41<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53, spans="tyle--0:#D9F5DD;--1:#11">1<111" spans="tyle--0:#ECC48D;--1:#98">41<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53, spans="tyle--0:#D6DEEB;--1:#40">36<1B0c spans="tyle--0:#D6DEEB;--1:#40">33F<53] ,divclass="Nameec-">3F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53invalid:< [] ,divclass="Nameec-">3F5<3}) ;divclass="Name"><})>

This rule is not configurable.