wix-incubator / jest-metadata

๐Ÿฆธโ€โ™‚๏ธ Superhero power for your Jest reporters! ๐Ÿฆธโ€โ™€๏ธ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Library does not warn about metadata server missing

noomorph opened this issue ยท comments

As #4212 has shown, there is an issue which is hard to troubleshoot. It emerges when a user forgets to configure a reporter inherited from jest-metadata/reporter.

Actual behavior: Users see unclear errors like:

JestMetadataError: No file metadata found for: /home/Projects/Detox/detox/test/integration/e2e/flaky.test.js
--
  |  
  | 4 \| const resolveFrom = require('resolve-from');
  | 5 \| const maybeNodeEnvironment = require(resolveFrom(process.cwd(), 'jest-environment-node'));
  | > 6 \| /** @type {typeof import('@jest/environment').JestEnvironment} */
  | \|                                                                  ^

Expected behavior: Users should see an error like:

JestMetadataError: Cannot use a metadata test environment without a metadata server.
Please check that at least one of the reporters in your Jest config inherits from "jest-metadata/reporter".
  "reporters": ["default"]

๐ŸŽ‰ This issue has been resolved in version 1.0.2 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€