File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646 for PROGRAM in sab dab; do
4747 echo "Processing projects for $PROGRAM"
4848 mkdir -p "$HOME/projects/$PROGRAM"
49- PROJECTS=$(jq -r ".${PROGRAM}.projects[]" "test_data/projects/index.json")
50- for PROJECT_ZIP in $PROJECTS; do
49+
50+ # Get all projects as JSON array
51+ PROJECTS_JSON=$(jq -r ".${PROGRAM}.projects" "test_data/projects/index.json")
52+
53+ # Get number of projects
54+ NUM_PROJECTS=$(echo "$PROJECTS_JSON" | jq '. | length')
55+
56+ # Iterate through projects using index
57+ for ((i=0; i<$NUM_PROJECTS; i++)); do
58+ # Get project path and test directories
59+ PROJECT_ZIP=$(echo "$PROJECTS_JSON" | jq -r ".[$i].path")
60+ TEST_DIRS=$(echo "$PROJECTS_JSON" | jq -r ".[$i].tests[]")
61+
5162 PROJECT_NAME=$(basename "$PROJECT_ZIP" .zip)
5263 echo "Project: $PROJECT_NAME"
5364 PROJECT_DIR="$HOME/projects/${PROGRAM}/$PROJECT_NAME"
6071 popd > /dev/null
6172 npm run build
6273 npm run convert
63- npm run test
74+
75+ # Run tests for each specified directory
76+ for TEST_DIR in $TEST_DIRS; do
77+ echo "Running tests in directory: $TEST_DIR"
78+ npm run test "$TEST_DIR"
79+ done
6480 done
65- done
81+ done
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import path from 'path';
33import type { DictionaryConfig , DictionaryWritingSystemConfig } from '$config' ;
44import jsdom from 'jsdom' ;
55import { expect , test } from 'vitest' ;
6- import { parseDictionaryWritingSystem , parseFeatures } from '../../../convert/ convertConfig' ;
6+ import { parseDictionaryWritingSystem , parseFeatures } from '../convertConfig' ;
77
88const dataDir = './data/' ;
99const dom = new jsdom . JSDOM ( readFileSync ( path . join ( dataDir , 'appdef.xml' ) ) . toString ( ) , {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import {
2222 parseTraits ,
2323 parseVideos ,
2424 parseWatermarkImages
25- } from '../../../convert/ convertConfig' ;
25+ } from '../convertConfig' ;
2626
2727const dataDir = './data/' ;
2828const dom = new jsdom . JSDOM ( readFileSync ( path . join ( dataDir , 'appdef.xml' ) ) . toString ( ) , {
Original file line number Diff line number Diff line change 11{
2- "sab" : {
3- "projects" : [
4- " web_gospels.zip" ,
5- " sab_pwa_test.zip"
2+ "sab" : {
3+ "projects" : [
4+ {
5+ "tests" : [
6+ " src/" ,
7+ " convert/"
8+ ],
9+ "path" : " web_gospels.zip"
10+ },
11+ {
12+ "tests" : [
13+ " src/"
14+ ],
15+ "path" : " sab_pwa_test.zip"
16+ }
617 ]
718 },
819 "dab" : {
9- "projects" : [
10- " hanga.zip"
20+ "projects" : [
21+ {
22+ "tests" : [
23+ " src/" ,
24+ " convert/"
25+ ],
26+ "path" : " hanga.zip"
27+ }
1128 ]
1229 }
1330}
You can’t perform that action at this time.
0 commit comments