@public-ui/visual-tests 3.0.2-d721ede5369345abe032367b7d05a7c5a20dca9b.0 → 3.0.2-f97556ada8a20e9abe2dbb519562bad234f7191b.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.
- package/README.md +0 -4
- package/package.json +2 -2
- package/src/index.js +8 -7
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# KoliBri - Visual Tests
|
|
2
2
|
|
|
3
|
-
Utilities for screenshot based regression testing of KoliBri themes.
|
|
4
|
-
|
|
5
3
|
[](https://www.npmjs.com/package/@public-ui/components)
|
|
6
4
|
[](https://github.com/public-ui/kolibri/blob/main/LICENSE)
|
|
7
5
|
[](https://www.npmjs.com/package/@public-ui/visual-tests)
|
|
@@ -61,5 +59,3 @@ Run the tests with `npm test`. The first time, this will create a new folder `sn
|
|
|
61
59
|
In the following runs, new screenshots will be compared to this reference.
|
|
62
60
|
|
|
63
61
|
To update the reference screenshots call `npm run test-update`.
|
|
64
|
-
|
|
65
|
-
For details on theming see the [default theme README](../../themes/default/README.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/visual-tests",
|
|
3
|
-
"version": "3.0.2-
|
|
3
|
+
"version": "3.0.2-f97556ada8a20e9abe2dbb519562bad234f7191b.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.37",
|
|
31
31
|
"serve": "14.2.4",
|
|
32
|
-
"@public-ui/sample-react": "3.0.2-
|
|
32
|
+
"@public-ui/sample-react": "3.0.2-f97556ada8a20e9abe2dbb519562bad234f7191b.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/eslint-parser": "7.27.5",
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as crypto from 'crypto';
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
import { readFile } from 'fs/promises';
|
|
4
1
|
import child_process from 'node:child_process';
|
|
5
2
|
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
4
|
+
import * as crypto from 'crypto';
|
|
5
|
+
import { readFile } from 'fs/promises';
|
|
6
|
+
import * as fs from 'fs';
|
|
6
7
|
import portfinder from 'portfinder';
|
|
7
8
|
import * as process from 'process';
|
|
8
|
-
import { fileURLToPath } from 'url';
|
|
9
9
|
|
|
10
10
|
const tempDir = process.env.RUNNER_TEMP || process.env.TMPDIR; // TODO: Check on Windows
|
|
11
11
|
|
|
@@ -27,14 +27,15 @@ if (!fs.existsSync(workingDir)) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const buildPath = path.join(tempDir, `kolibri-visual-testing-build-${crypto.randomUUID()}`);
|
|
30
|
-
const
|
|
31
|
-
const
|
|
30
|
+
const rawPackageJsonPath = new URL(path.join(workingDir, 'package.json'), import.meta.url).href;
|
|
31
|
+
const packageJsonPath = process.platform === 'win32' ? pathToFileURL(rawPackageJsonPath) : rawPackageJsonPath;
|
|
32
|
+
const packageJsonContent = await readFile(new URL(packageJsonPath, import.meta.url), 'utf8');
|
|
32
33
|
const packageJson = JSON.parse(packageJsonContent);
|
|
33
34
|
|
|
34
35
|
console.log(`
|
|
35
36
|
Building React Sample App (v${packageJson?.version ?? '#.#.#'}) …`);
|
|
36
37
|
|
|
37
|
-
const buildResult = child_process.spawnSync('pnpm', ['run', 'build', `--outDir
|
|
38
|
+
const buildResult = child_process.spawnSync('pnpm', ['run', 'build', `--outDir="${buildPath}"`], {
|
|
38
39
|
cwd: workingDir,
|
|
39
40
|
encoding: 'utf-8',
|
|
40
41
|
shell: true,
|