File tree Expand file tree Collapse file tree 4 files changed +45
-12
lines changed Expand file tree Collapse file tree 4 files changed +45
-12
lines changed Original file line number Diff line number Diff line change 46
46
for PROGRAM in sab dab; do
47
47
echo "Processing projects for $PROGRAM"
48
48
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
+
51
62
PROJECT_NAME=$(basename "$PROJECT_ZIP" .zip)
52
63
echo "Project: $PROJECT_NAME"
53
64
PROJECT_DIR="$HOME/projects/${PROGRAM}/$PROJECT_NAME"
60
71
popd > /dev/null
61
72
npm run build
62
73
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
64
80
done
65
- done
81
+ done
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import path from 'path';
3
3
import type { DictionaryConfig , DictionaryWritingSystemConfig } from '$config' ;
4
4
import jsdom from 'jsdom' ;
5
5
import { expect , test } from 'vitest' ;
6
- import { parseDictionaryWritingSystem , parseFeatures } from '../../../convert/ convertConfig' ;
6
+ import { parseDictionaryWritingSystem , parseFeatures } from '../convertConfig' ;
7
7
8
8
const dataDir = './data/' ;
9
9
const 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 {
22
22
parseTraits ,
23
23
parseVideos ,
24
24
parseWatermarkImages
25
- } from '../../../convert/ convertConfig' ;
25
+ } from '../convertConfig' ;
26
26
27
27
const dataDir = './data/' ;
28
28
const dom = new jsdom . JSDOM ( readFileSync ( path . join ( dataDir , 'appdef.xml' ) ) . toString ( ) , {
Original file line number Diff line number Diff line change 1
1
{
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
+ }
6
17
]
7
18
},
8
19
"dab" : {
9
- "projects" : [
10
- " hanga.zip"
20
+ "projects" : [
21
+ {
22
+ "tests" : [
23
+ " src/" ,
24
+ " convert/"
25
+ ],
26
+ "path" : " hanga.zip"
27
+ }
11
28
]
12
29
}
13
30
}
You can’t perform that action at this time.
0 commit comments