11{%- if flavor contains "vanilla-js" -%}
22import { describe, it, expect } from 'vitest';
3- import deliveryOptionGenerator from './index ';
3+ import { run } from './run ';
44
55/**
6- * @typedef {import("../generated/api").FunctionResult} FunctionResult
6+ * @typedef {import("../generated/api").RunInput} RunInput
7+ * @typedef {import("../generated/api").FunctionRunResult} FunctionRunResult
78 */
89
910describe('local pickup delivery option generator function', () => {
1011 it('returns a delivery option', () => {
11- const result = deliveryOptionGenerator ({
12+ const result = run ({
1213 cart: {
1314 lines: [
1415 {
@@ -43,7 +44,7 @@ describe('local pickup delivery option generator function', () => {
4344 metafield: null
4445 }
4546 });
46- const expected = /** @type {FunctionResult } */ ({
47+ const expected = /** @type {FunctionRunResult } */ ({
4748 operations: [
4849 {
4950 add: {
@@ -63,12 +64,12 @@ describe('local pickup delivery option generator function', () => {
6364});
6465{%- elsif flavor contains "typescript" -%}
6566import { describe, it, expect } from 'vitest';
66- import deliveryOptionGenerator from './index ';
67- import { FunctionResult } from '../generated/api';
67+ import { run } from './run ';
68+ import { RunInput, FunctionRunResult } from '../generated/api';
6869
6970describe('local pickup delivery option generator function', () => {
7071 it('returns a delivery option', () => {
71- const result = deliveryOptionGenerator ({
72+ const result = run ({
7273 cart: {
7374 lines: [
7475 {
@@ -103,7 +104,7 @@ describe('local pickup delivery option generator function', () => {
103104 metafield: null
104105 }
105106 });
106- const expected: FunctionResult = {
107+ const expected: FunctionRunResult = {
107108 operations: [
108109 {
109110 add: {
0 commit comments