@public-ui/visual-tests 2.2.8 → 2.2.9-e23d25025d25a8a8d9e50b2b9e84275dba2b92d4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.js +2 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/visual-tests",
3
- "version": "2.2.8",
3
+ "version": "2.2.9-e23d25025d25a8a8d9e50b2b9e84275dba2b92d4.0",
4
4
  "license": "EUPL-1.2",
5
5
  "homepage": "https://public-ui.github.io",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "axe-playwright": "2.1.0",
30
30
  "portfinder": "1.0.35",
31
31
  "serve": "14.2.4",
32
- "@public-ui/sample-react": "2.2.8"
32
+ "@public-ui/sample-react": "2.2.9-e23d25025d25a8a8d9e50b2b9e84275dba2b92d4.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@babel/eslint-parser": "7.26.10",
package/src/index.js CHANGED
@@ -19,15 +19,8 @@ if (!tempDir) {
19
19
  process.env.THEME_MODULE = path.join(process.cwd(), process.env.THEME_MODULE); // Use current working directory (i.e. the theme folder) to complete module path
20
20
  const visualsTestModulePath = fileURLToPath(new URL('..', import.meta.url));
21
21
  const binaryPath = fileURLToPath(new URL('../node_modules/.bin', import.meta.url));
22
-
23
- let sampleReactPath = '../node_modules/@public-ui/visual-tests/node_modules/@public-ui/sample-react';
24
- let backSteps = ``;
25
- let workingDir = null;
26
- do {
27
- const url = new URL(backSteps + sampleReactPath, import.meta.url);
28
- workingDir = fileURLToPath(url);
29
- backSteps += `../`;
30
- } while (!fs.existsSync(workingDir) && path.resolve(process.cwd(), backSteps) !== '/');
22
+ const sampleReactPackageJsonPath = import.meta.resolve('@public-ui/sample-react/package.json');
23
+ const workingDir = fileURLToPath(path.dirname(sampleReactPackageJsonPath));
31
24
 
32
25
  if (!fs.existsSync(workingDir)) {
33
26
  throw new Error('Could not find React Sample App package. Please install it with "npm install @public-ui/sample-react".');