File tree Expand file tree Collapse file tree 3 files changed +27
-6
lines changed
Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,6 @@ pub fn run(params: FunctionRunParams) -> Result<FunctionRunResult> {
292292fn try_parse_as_msgpack ( raw_output : & [ u8 ] ) -> FunctionOutput {
293293 match rmp_serde:: from_slice :: < serde_json:: Value > ( raw_output) {
294294 Ok ( json_output) => {
295- // If we get a number that matches the first byte's ASCII value, it's likely text
296295 if let Some ( n) = json_output. as_u64 ( ) {
297296 if n < 127 && raw_output. len ( ) > 1 && raw_output[ 0 ] as u64 == n {
298297 // This is likely text being misinterpreted as a number
@@ -477,10 +476,8 @@ mod tests {
477476 let module = Module :: from_file ( & Engine :: default ( ) , module_path) . unwrap ( ) ;
478477 assert ! ( !uses_wasm_api_provider( & module) ) ;
479478
480- // This test will only pass if you have a test function compiled with the wasm api provider
481- // If this test fails, you may need to create such a test fixture.
482- // let wasm_api_module_path = Path::new("tests/fixtures/build/wasm_api_function.wasm");
483- // let wasm_api_module = Module::from_file(&Engine::default(), wasm_api_module_path).unwrap();
484- // assert!(uses_wasm_api_provider(&wasm_api_module));
479+ let wasm_api_module_path = Path :: new ( "tests/fixtures/build/wasm_api_function.merged.wasm" ) ;
480+ let wasm_api_module = Module :: from_file ( & Engine :: default ( ) , wasm_api_module_path) . unwrap ( ) ;
481+ assert ! ( uses_wasm_api_provider( & wasm_api_module) ) ;
485482 }
486483}
Original file line number Diff line number Diff line change 1+ {
2+ "cart" : {
3+ "lines" : [
4+ {
5+ "merchandise" : {
6+ "id" : " gid://shopify/ProductVariant/1" ,
7+ "title" : " Sample Product"
8+ },
9+ "quantity" : 2 ,
10+ "cost" : {
11+ "totalAmount" : {
12+ "amount" : " 24.99" ,
13+ "currencyCode" : " USD"
14+ }
15+ }
16+ }
17+ ]
18+ },
19+ "discounts" : {
20+ "metafield" : {
21+ "value" : " {\" percentage\" :20,\" applicable_items\" :[\" gid://shopify/ProductVariant/1\" ]}"
22+ }
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments