Skip to content

Commit aa19fb5

Browse files
committed
make sample tests consistent with templates
* move vitest and test script to the extension itself * ensure sample tests run with workspace tests
1 parent b88a5ca commit aa19fb5

File tree

8 files changed

+24
-23
lines changed

8 files changed

+24
-23
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
"private": true,
2121
"workspaces": [
22-
"*/javascript/**"
22+
"*/javascript/**",
23+
"sample-apps/*/extensions/*-js"
2324
]
2425
}

sample-apps/delivery-customizations/extensions/delivery-customization-js/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"shopify": "npm exec -- shopify",
77
"typegen": "npm exec -- shopify app function typegen",
88
"build": "npm exec -- shopify app function build",
9-
"preview": "npm exec -- shopify app function run"
9+
"preview": "npm exec -- shopify app function run",
10+
"test": "vitest"
1011
},
1112
"codegen": {
1213
"schema": "schema.graphql",
@@ -19,5 +20,8 @@
1920
]
2021
}
2122
}
23+
},
24+
"devDependencies": {
25+
"vitest": "^0.29.2"
2226
}
2327
}

sample-apps/delivery-customizations/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@
99
"dev": "shopify app dev",
1010
"info": "shopify app info",
1111
"generate": "shopify app generate",
12-
"deploy": "shopify app deploy",
13-
"test": "vitest"
12+
"deploy": "shopify app deploy"
1413
},
1514
"dependencies": {
1615
"@shopify/app": "^3.45.0",
1716
"@shopify/cli": "^3.45.0",
1817
"@shopify/shopify_function": "0.0.3",
1918
"javy": "0.0.3"
2019
},
21-
"author": "andrewhassan",
22-
"devDependencies": {
23-
"vitest": "^0.29.2"
24-
}
20+
"author": "andrewhassan"
2521
}

sample-apps/discounts/extensions/product-discount-js/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"shopify": "npm exec -- shopify",
77
"typegen": "npm exec -- shopify app function typegen",
88
"build": "npm exec -- shopify app function build",
9-
"preview": "npm exec -- shopify app function run"
9+
"preview": "npm exec -- shopify app function run",
10+
"test": "vitest"
1011
},
1112
"codegen": {
1213
"schema": "schema.graphql",
@@ -19,5 +20,8 @@
1920
]
2021
}
2122
}
23+
},
24+
"devDependencies": {
25+
"vitest": "^0.29.2"
2226
}
2327
}

sample-apps/discounts/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@
99
"dev": "shopify app dev",
1010
"info": "shopify app info",
1111
"generate": "shopify app generate",
12-
"deploy": "shopify app deploy",
13-
"test": "vitest"
12+
"deploy": "shopify app deploy"
1413
},
1514
"dependencies": {
1615
"@shopify/app": "^3.45.0",
1716
"@shopify/cli": "^3.45.0",
1817
"@shopify/shopify_function": "0.0.3",
1918
"javy": "0.0.3"
2019
},
21-
"author": "nickwesselman",
22-
"devDependencies": {
23-
"vitest": "^0.29.2"
24-
}
20+
"author": "nickwesselman"
2521
}

sample-apps/payment-customizations/extensions/payment-customization-js/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"shopify": "npm exec -- shopify",
77
"typegen": "npm exec -- shopify app function typegen",
88
"build": "npm exec -- shopify app function build",
9-
"preview": "npm exec -- shopify app function run"
9+
"preview": "npm exec -- shopify app function run",
10+
"test": "vitest"
1011
},
1112
"codegen": {
1213
"schema": "schema.graphql",
@@ -19,5 +20,8 @@
1920
]
2021
}
2122
}
23+
},
24+
"devDependencies": {
25+
"vitest": "^0.29.2"
2226
}
2327
}

sample-apps/payment-customizations/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@
99
"dev": "shopify app dev",
1010
"info": "shopify app info",
1111
"generate": "shopify app generate",
12-
"deploy": "shopify app deploy",
13-
"test": "vitest"
12+
"deploy": "shopify app deploy"
1413
},
1514
"dependencies": {
1615
"@shopify/app": "^3.45.0",
1716
"@shopify/cli": "^3.45.0",
1817
"@shopify/shopify_function": "0.0.3",
1918
"javy": "0.0.3"
2019
},
21-
"author": "andrewhassan",
22-
"devDependencies": {
23-
"vitest": "^0.29.2"
24-
}
20+
"author": "andrewhassan"
2521
}

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3290,7 +3290,7 @@ vite-node@0.29.8:
32903290
optionalDependencies:
32913291
fsevents "~2.3.2"
32923292

3293-
vitest@^0.29.8:
3293+
vitest@^0.29.2, vitest@^0.29.8:
32943294
version "0.29.8"
32953295
resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.29.8.tgz#9c13cfa007c3511e86c26e1fe9a686bb4dbaec80"
32963296
integrity sha512-JIAVi2GK5cvA6awGpH0HvH/gEG9PZ0a/WoxdiV3PmqK+3CjQMf8c+J/Vhv4mdZ2nRyXFw66sAg6qz7VNkaHfDQ==

0 commit comments

Comments
 (0)