Skip to content

Commit

Permalink
chore: upload original snapshots of diff
Browse files Browse the repository at this point in the history
  • Loading branch information
Aarebecca committed Dec 10, 2024
1 parent bab7a63 commit e384f82
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
pnpm exec playwright test
- name: Collect unit test results
if: always()
run: |
node scripts/coverage.mjs
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"d3-hierarchy": "^3.1.2",
"eslint": "^8.57.1",
"eslint-plugin-jsdoc": "^46.10.1",
"glob": "^11.0.0",
"husky": "^8.0.3",
"iperf": "0.1.0-beta.14",
"jest": "^29.7.0",
Expand Down
21 changes: 21 additions & 0 deletions scripts/coverage.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { copyFileSync, mkdirSync } from 'fs';
import { globSync } from 'glob';
import { join } from 'path';

const pattern = 'packages/g6/__tests__/snapshots/**/*-actual.svg';

const files = globSync(pattern, { nodir: true });

mkdirSync('artifact');

for (const file of files) {
const path = file.split('/');
const fileName = path.pop();
const folder = path.slice(4).join('/');

mkdirSync(`artifact/${folder}`, { recursive: true });
copyFileSync(file, join('artifact', folder, fileName));

const original = file.replace('-actual', '');
copyFileSync(original, join('artifact', folder, fileName.replace('-actual', '')));
}

0 comments on commit e384f82

Please sign in to comment.