Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Trigger CI for #4673: fix(integration-karma): run hydration preprocessor just for focused tests #4676

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

'use strict';

const path = require('path');
const path = require('node:path');

const { globSync } = require('node:fs');
const { ENABLE_SYNTHETIC_SHADOW_IN_HYDRATION } = require('../../shared/options');

const karmaPluginHydrationTests = require('../../karma-plugins/hydration-tests');
Expand Down Expand Up @@ -36,14 +37,27 @@ const ALL_FRAMEWORK_FILES = [SYNTHETIC_SHADOW, LWC_ENGINE];
process.setMaxListeners(1000);

function getFiles() {
return [
const files = [
...(ENABLE_SYNTHETIC_SHADOW_IN_HYDRATION ? [createPattern(SYNTHETIC_SHADOW)] : []),
createPattern(LWC_ENGINE),
createPattern(TEST_SETUP),
createPattern(TEST_UTILS),
createPattern(TEST_HYDRATE),
createPattern('**/*.spec.js', { watched: false }),
];

// check if a .only file exists
const onlyFile = globSync('**/*/.only', { cwd: BASE_DIR, absolute: true });

if (onlyFile.length > 0) {
for (const file of onlyFile) {
const dir = path.dirname(file);
files.push(createPattern(`${dir}/**/*.spec.js`, { watched: false }));
}
} else {
files.push(createPattern('**/*.spec.js', { watched: false }));
}

return files;
}

/**
Expand Down
Loading