Only bundle the release build, and don't import src in tests (#13978)

* Only bundle the release build, and don't import `src` in tests

* Use file extension to signal skipping

* Remove unnecessary config change

* Fix imports
This commit is contained in:
Nicolò Ribaudo
2021-11-24 16:08:53 +01:00
committed by GitHub
parent 75996cb62b
commit ad1798ed48
12 changed files with 28 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
const supportsESM = parseInt(process.versions.node) >= 12;
const isPublishBundle = process.env.IS_PUBLISH;
module.exports = {
collectCoverageFrom: [
@@ -23,6 +24,9 @@ module.exports = {
"<rootDir>/build/",
"<rootDir>/.history/", // local directory for VSCode Extension - https://marketplace.visualstudio.com/items?itemName=xyz.local-history
"_browser\\.js",
// Some tests require internal files of bundled packages, which are not available
// in production builds. They are marked using the .skip-bundled.js extension.
...(isPublishBundle ? ["\\.skip-bundled\\.js$"] : []),
],
testEnvironment: "node",
setupFilesAfterEnv: ["<rootDir>/test/testSetupFile.js"],