ekino / veggies

:sparkles: :rocket: Veggies is an awesome cucumberjs library for API/CLI testing. Great for testing APIs built upon Express, Koa, HAPI, Loopback and others. It's also the perfect companion for testing CLI applications built with commander, meow & Co.
https://ekino.github.io/veggies/
MIT License
90 stars 18 forks source link

fix(snapshot): remove usage of private variable from jest-diff #71

Closed fthouraud closed 3 years ago

fthouraud commented 3 years ago

Hi 👋

While testing the new version of Veggies, I saw an error regarding access to a non-exported object.

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './build/constants' is not defined by "exports" in /usr/src/app/node_modules/@ekino/veggies/node_modules/jest-diff/package.json
    at throwExportsNotFound (internal/modules/esm/resolve.js:299:9)
    at packageExportsResolve (internal/modules/esm/resolve.js:522:3)
    at resolveExports (internal/modules/cjs/loader.js:449:36)
    at Function.Module._findPath (internal/modules/cjs/loader.js:489:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:875:27)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/usr/src/app/node_modules/@ekino/veggies/src/extensions/snapshot/snapshot.js:10:27)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/usr/src/app/node_modules/@ekino/veggies/src/extensions/snapshot/clean.js:9:18)
codepath: /usr/src/app/tests/functional/support/hooks.js

This is related to this PR: facebook/jest#9921.

I'm not sure why this error did not show up on our tests 🤷