Skip to content

v0.14.1

Choose a tag to compare

@github-actions github-actions released this 05 Nov 19:33
· 229 commits to main since this release
df91408

Patch Changes

  • 0dd12ca: Native engine: a React Native package's required peer that your package manager installs for you (pnpm, npm 7+ and bun do), such as expo-router's expo-linking, is now compiled. No action needed. Remove transform: ['expo-linking'] if you added it for this.

    • Before, a required peer that no package.json declared stayed uncompiled. It then failed with "Cannot require() ES Module … not yet fully loaded" or "Cannot find module …/Linking.types".
    • Optional peers, and peers a package names only in its config plugin, scripts or types, are still not followed.

    Thanks @AntSplash360 for reporting this (#296).

  • 967d3cf: Under the native engine, a relative import whose name has a dot, such as ./Linking.types, now resolves. A package that Node loads as an ES module failed with "Cannot find module …/Linking.types" because the part after the dot was read as a file extension. Only a known source or asset extension counts now, as in Metro, so ./Linking.types finds Linking.types.js, and a platform variant such as Theme.config.native.js wins over Theme.config.js. No action needed.

    Thanks @AntSplash360 for reporting this (#296).

  • 8ea7273: vitest-native migrate now reads jest.config.ts, .mjs, .mts and .cts, in Jest's own lookup order. TypeScript configs load through Node's type stripping (Node 22.18 or later). A config that still can't be loaded, such as one that relies on ts-node (an extensionless relative import, an enum), uses top-level await or exports a function, is now listed under "Needs your attention" with the reason, where before the report silently left out its settings. No action needed.

  • e5ff183: vitest-native migrate now warns when the project's Babel config makes imports lazy under Jest. With babel-preset-expo's lazyImports, @react-native/babel-preset's lazyImportExportTransform, the CommonJS transform's lazy option or an inline-requires plugin, Jest ran a package import only when a test first used it, while vitest-native runs every import when its file loads. A module a test never touched is then evaluated, and a partial jest.mock of something it needs can fail. The report now lists the setting under "Needs your attention". Babel plugin names under the @babel/ scope are also now read the way Babel reads them.

    Use jest.requireActual to give such a mock the rest of its module: jest.mock('x', () => ({ ...jest.requireActual('x'), ... })).

What's Changed

  • fix(migrate): read jest.config.ts, .mjs, .mts and .cts in Jest's lookup order by @danfry1 in #512
  • test: start the Babel worker before the tests that transform by @danfry1 in #514
  • fix(migrate): flag Babel settings that made imports lazy under Jest by @danfry1 in #515
  • docs(readme): one short README for GitHub and npm by @danfry1 in #518
  • docs(site): make the getting-started snippets run under the default engine by @danfry1 in #520
  • fix(native): compile a required React Native peer a compiled package loads, though nothing declares it by @danfry1 in #519
  • docs(site): one Mocking page for vi.mock reach, untranspiled packages and fake timers by @danfry1 in #521
  • fix(native): a relative import with a dot in its name resolves, as in Metro by @danfry1 in #509
  • test(museum): pfs-hot-unawaited-act fails by name with one worker, its accepted outcome by @danfry1 in #517
  • test(docs): run the README and quick-start snippets against the packed package by @danfry1 in #522
  • chore(release): 0.14.1 by @danfry1 in #524

Full Changelog: v0.14.0...v0.14.1