From ed7777462ad8b04d24def2e00d0669703f30e4ea Mon Sep 17 00:00:00 2001 From: Rene Haas Date: Sun, 30 Oct 2022 21:03:52 +0100 Subject: [PATCH] improve treeshaking test --- packages/overlayscrollbars/.gitignore | 3 ++- .../overlayscrollbars/test/jest-node/treeshaking.test.ts | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/overlayscrollbars/.gitignore b/packages/overlayscrollbars/.gitignore index cd39e82..3600e1d 100644 --- a/packages/overlayscrollbars/.gitignore +++ b/packages/overlayscrollbars/.gitignore @@ -1,8 +1,9 @@ # Compiled output /dist -# Playwright output +# Tests generated output .build/ +.fixtures/ # Node /node_modules diff --git a/packages/overlayscrollbars/test/jest-node/treeshaking.test.ts b/packages/overlayscrollbars/test/jest-node/treeshaking.test.ts index ba1c01d..e9c62f5 100644 --- a/packages/overlayscrollbars/test/jest-node/treeshaking.test.ts +++ b/packages/overlayscrollbars/test/jest-node/treeshaking.test.ts @@ -10,14 +10,14 @@ import rollupConfig from '~/../rollup.config'; const cleanBundle = true; const cleanFixture = true; -const expectedBundleDiff = 2300; +const expectedBundleDiff = 2400; const normalizePath = (pathName: string) => pathName ? pathName.split(path.sep).join(path.posix.sep) : pathName; -const fixturesDir = path.join(__dirname, '.treeshakingFixtures'); +const fixturesDir = path.join(__dirname, '.fixtures'); const libraryFixturePath = normalizePath(path.join(fixturesDir, 'lib.js')); -const normalFixturePath = normalizePath(path.join(fixturesDir, 'nromal.js')); +const normalFixturePath = normalizePath(path.join(fixturesDir, 'normal.js')); const treeshakedFixturePath = normalizePath(path.join(fixturesDir, 'treeshaked.js')); const unshakedFixtureContent = ` @@ -88,7 +88,7 @@ const bundleFunctions = { const testBundler = (bundlerName: string) => async () => { const bundleFunction = bundleFunctions[bundlerName]; - const outputDir = path.join(__dirname, `.${bundlerName}`); + const outputDir = path.join(fixturesDir, `.${bundlerName}`); const normal = await bundleFunction( normalFixturePath, path.join(outputDir, path.basename(normalFixturePath))