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:
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user