Repository navigation
v0.5.0
Minor Changes
-
#51
acec7e7- Each file record has a newconfigkey: the config the file uses, as the runner started at the root would pick it.
That is the outermost config at or above the file that runs it, and for Vitestprojectsthe project that does,
read from Playwright'stestDir,testMatch,testIgnoreand.gitignorefiles, and from Vitest'sinclude,
exclude,includeSource,typecheck.includeandbenchmark.includewith each version's defaults. Before, the
nearest config was taken, which is wrong for a root config whoseincludecovers packages that have their own
vite.config.ts. A file with tests that no config runs gets the newfile-not-runwarning.The globals check follows the same choice, so a test in a folder project without a config of its own gets Vitest's
defaults, and a test the root config runs takes the root'stest.globals. Files named bybenchmark.includeare
markedisBenchmark, in place of the default*.bench.*and*.benchmark.*names. The config reader now reads
regular expressions and paths built from__dirname,__filenameorimport.metawithpath.join(),
path.resolve(),path.dirname(),fileURLToPath()andnew URL(). -
#50
3e55445- The output lists the configs the scanned files use in a new top-levelconfigskey, and asconfiglines in JSON
Lines. A file uses the nearestplaywright.config.*,vitest.config.*orvite.config.*in its folder or a folder
above, up to the root, as the runner started in that folder would. A config is read as code, never run, andextends
lists the files it takes settings from through imports, such as a shared base config.Vitest's globals now come from
test.globalsin the config a file uses, read throughdefineConfig(),
mergeConfig(), spreads, constants and imported base configs. Before, anyglobals: truein a Vitest or Vite config
in the file's folder or a folder above counted, also one Vitest doesn't read for the file, as in avite.config.ts
next to avitest.config.ts. Soglobals-not-enabledcan now appear where it didn't, and go away where a base config
turns globals on. Atest.globalsthe scan can't work out without running the config, and a config it can't read,
get the newconfig-value-unknownwarning. -
#55
a714612- Run settings now come also from the config a file uses: Playwright'stimeout,retriesandrepeatEach, and
Vitest'stestTimeout,retryandrepeats, where the file sets none. NewtimeoutSource,retriesSourceandrepeatsSource
keys say where each value comes from:test,suite,fileorconfig, ornullwhen nothing sets it. A test
takes the settings of the projects that run it, after theirgrep. When those projects disagree, the config sets the
value under a condition, as inprocess.env.CI ? 2 : 0, or the scan can't work out the projects, the value isnull
with its sourceconfig. For a value under a condition,timeoutConfigText,retriesConfigTextand
repeatsConfigTexthold the config's text for it, soretries: process.env.CI ? 2 : 0reads as written. Playwright'sfullyParalleland Vitest'ssequence.concurrentmake tests
isParallelwhere the file sets no mode, when every project that runs the test sets it.A
.onlyin a Playwright file whose config setsforbidOnlygets the newforbidden-onlyerror, since the run then
fails before any test runs. WhenforbidOnlydepends on a condition, as in!!process.env.CI, it is a warning that
quotes the condition. -
#59
aeb3eb1- Vitest tags the config defines intest.tagsnow apply to the tests that carry them, as Vitest applies them. Their
skip,todo,failsandonlyare merged with the test's own and those a describe passes down, and Vitest's order,
onlyoverskipovertodo, gives the state, with the newstateSourcevalueconfigwhen a tag sets it. Their
concurrent,timeout,retry,repeatsandmetaset those keys where the test sets none: from Vitest 5 over a
describe's options, and in Vitest 4.1 under them. The lowestprioritywins between tags, and a Vitest 5 project's
owntagsreplace those of the config it extends.A tag the config doesn't define fails the file in Vitest unless
strictTagsis off, also when there is no config, so
it now gets the newundefined-tagerror, and the file's tests arenotLoaded; in a function or under a condition it
is a warning, as that code may not run. Theconfig-may-change-statewarning now shows only when
the scan can't work out the config's tags. -
#54
c610789- Each test record has a newprojectskey: the names of the projects that run the test, of the config its file uses.
For Playwright, those whosetestDir,testMatchandtestIgnoreinclude the file, less those whosegrepor
grepInvertleaves the test's title and tags out; for Vitest, those whose files include it, with each browser
instance as a project, named as Vitest names it, such asunit (chromium). It is[]when no project runs the test,
andnullwithout a config or when the scan can't tell. Config records list their projects inprojects, each with
itsname,testDirand Playwright'sdependencies. -
#53
b9471ec- Glob patterns are optional, inscan()and on the command line: without them, the test files are those the
Playwright or Vitest configs in the root and the folders below it run, each with the config it uses. A config whose
files the scan can't work out gets aconfig-value-unknownwarning that says to give patterns, and a scan without
patterns and without a config says so inno-files-matched. An empty list of patterns is still an error.