Repository navigation
v0.8.0
Minor Changes
-
#75
f6690bb---framework(library:framework) is now optional. Without it, the scan takes the runner the project uses: the one
whose package apackage.jsonin the root or below it lists, or whose config file is there, else one apackage.json
above the root lists. A project with several runners, or none, gets a usage error (aTypeErrorin the library) that
names what it found. -
#75
f6690bb- Jest 29 and 30:--framework jest(library:framework: 'jest') lists the tests of Jest files with the same keys as
Playwright and Vitest tests. It reads Jest's globals,fit,xit,xtest,fdescribeandxdescribeamong them,
imports andrequire()of@jest/globals, the chains Jest has, such astest.concurrent.only.each,.failingas
expectedToFail, the timeout passed third,jest.retryTimes()asretriesfor every test of the file (from 30.5,
withentireDescribe, of its describe) andwaitBeforeRetryasretryDelay, and@grouppragmas as tags, as
jest-runner-groups reads them.--expand-casestitles each case as jest-each 29 and 30 do. Calls Jest refuses, such
astest.only.concurrent,test('title')without a function or an async describe, mark the file's testsnotLoaded.Without globs, the test files come from the Jest config, read as Jest reads it:
jest.config.*, elsepackage.json,
withroots,testMatch,testRegex, the ignore patterns,moduleFileExtensions,projectsnamed by
displayName,testTimeoutandinjectGlobals, also through Jest 30.3'sdefineConfig()andmergeConfig();
without any config, Jest's defaults apply.frameworkin the output
can now bejest, an open set, soschemaVersionstays 1.The
cases-not-expandedmessage no longer names Vitest, as Jest tables can get it too.
Patch Changes
-
#75
f6690bb-require()of a local file is followed as an import is: tables, titles and other values it exports, with
module.exportsorexports.name, are read, and helper functions it exports that declare tests are followed. A
helper function a shared file imports and exports again, as anindex.jsof helpers does, is followed to where it is
written, instead of getting anunresolved-test-importerror. A helpers file may export a test function it takes from
the runner's globals, asexport const pendingTest = xit, or from the framework's module, with its modifiers. -
#75
f6690bb- A call the runner refuses, such astest.only.skip(...), that is only reached under a condition no longer marks every
test of its filenotLoaded, as the file loads unless the condition holds; the call is still reported. A test function
chosen with&&,||or??, as inconst onCi = process.env.CI && test.skip || test, is read like one chosen with
?:. In a config, a list with a spread the scan can't work out keeps the items it can. -
#75
f6690bb- A config thatrequire()s a local file, as a CommonJS config does with a shared base, now reads what that file
exports, as animportof it already did, and a JSON file, required or imported, is read as its value. -
#75
f6690bb- A table or loop gets itscaseCountwhen its length is known even if one of its values isn't, as in
[NaN, Infinity].forEach(...)or a table with a call in a row. A test or describe titled by a function or class
written in place, asdescribe(function OrderBook() {}, ...), takes its name, as the runners do. Code the parser
fails to hand over, such as a JSX name written as a Unicode escape, gets aparse-errorinstead of an
internal-error. -
#75
f6690bb-dependencyHashis faster on large projects: the files a test file and its describes reach are put together once for
all their tests, and a workspace's packages are found once, not once per folder that imports one. A scan of the Nx
repository with 17,571 tests went from 19.4 to 11.9 seconds. Hashes are unchanged.