Skip to content

nodeTestImports

Reports importing from node:test.

✅ This rule is included in the vitest logical and logicalStrict presets.

Vitest and Node.js’s built-in test runner provide similar APIs, but they are different test runners with different execution models and features. Importing from node:test inside Vitest-targeted files usually means the wrong runner API was imported.

AEimpo53 { describe, it <} sp ansty="le--0:#C792EA;--1:#8844">AEfr5<3 sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dnode:te1<1"sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meec-li">dB0descri5<3(sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dma1<1"sp ansty="le--0:#D6DEEB;--1:#403F">53<, sp ansty="le--0:#D9F5DD;--1:#1111">11<()sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C792EA;--1:#8844">AE<=>sp ansty="le--0:#D6DEEB;--1:#403F">53sp>< {d ivclassNa="meec-li">nt< sp ansty="le--0:#82AAFF;--1:#3B61">B05<3(sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dadds valu1<1"sp ansty="le--0:#D6DEEB;--1:#403F">53<, sp ansty="le--0:#D9F5DD;--1:#1111">11<()sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C792EA;--1:#8844">AE<=>sp ansty="le--0:#D6DEEB;--1:#403F">53 {}sp><);d ivclassNa="meec-li">53}<);d ivclassNa="meco"><);d>AEimpo5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B<0*sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C792EA;--1:#8844">AE53 tesAEfr5<3 sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dnode:te1<1"sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meec-li">d53teAB0descri5<3(sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dma1<1"sp ansty="le--0:#D6DEEB;--1:#403F">53<, sp ansty="le--0:#D9F5DD;--1:#1111">11<()sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C792EA;--1:#8844">AE<=>sp ansty="le--0:#D6DEEB;--1:#403F">53sp>< {d ivclassNa="meec-li">53< sp ansty="le--0:#D6DEEB;--1:#403F">53teAB05<3(sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dsubtracts valu1<1"sp ansty="le--0:#D6DEEB;--1:#403F">53<, sp ansty="le--0:#D9F5DD;--1:#1111">11<()sp ansty="le--0:#D6DEEB;--1:#403F">5<3 sp ansty="le--0:#C792EA;--1:#8844">AE<=>sp ansty="le--0:#D6DEEB;--1:#403F">53 {}sp><);d ivclassNa="meec-li">53}<);d ivclassNa="meco"><);d>
44AEim3F53 { describe, i44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dvi1<111" spans="tyle--0:#D6DEEB;--1:#40">3c61B0desc31<111" spans="tyle--0:#ECC48D;--1:#98">4E4D1<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53, spans="tyle--0:#D9F5DD;--1:#11">11<11() spans="tyle--0:#D6DEEB;--1:#40">344 spans="tyle--0:#D6DEEB;--1:#40">3F><53 {divclass="Nameec-">de6131<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dadds va1<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53, spans="tyle--0:#D9F5DD;--1:#11">11<11() spans="tyle--0:#D6DEEB;--1:#40">344 spans="tyle--0:#D6DEEB;--1:#40">3F53 ><{}) ;divclass="Nameec-">3F5<3}) ;divclass="Name"><})><;di vdivclass="Nameexpressive-">44AEim36<1B0* spans="tyle--0:#D6DEEB;--1:#40">3443F53 vit44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dvi1<111" spans="tyle--0:#D6DEEB;--1:#40">3c3F53vi4<4AE. spans="tyle--0:#82AAFF;--1:#3B">61B0desc31<111" spans="tyle--0:#ECC48D;--1:#98">4E4D1<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53, spans="tyle--0:#D9F5DD;--1:#11">11<11() spans="tyle--0:#D6DEEB;--1:#40">344 spans="tyle--0:#D6DEEB;--1:#40">3F><53 {divclass="Nameec-">3F<53 spans="tyle--0:#D6DEEB;--1:#40">3F53vi4<4AE. spans="tyle--0:#82AAFF;--1:#3B">6131<111" spans="tyle--0:#ECC48D;--1:#98">4E4Dsubtracts va1<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53, spans="tyle--0:#D9F5DD;--1:#11">11<11() spans="tyle--0:#D6DEEB;--1:#40">344 spans="tyle--0:#D6DEEB;--1:#40">3F53 ><{}) ;divclass="Nameec-">3F5<3}) ;divclass="Name"><})>

This rule is not configurable.

If a file is intentionally written for Node.js’s built-in test runner, you should not apply the Vitest plugin to that file. In mixed repositories, prefer separate Flint file globs or config entries so node:test files and Vitest files are linted with the right plugin.