-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathrun.test.liquid
More file actions
38 lines (33 loc) · 1.11 KB
/
run.test.liquid
File metadata and controls
38 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{%- if flavor contains "vanilla-js" -%}
import { describe, it, expect } from 'vitest';
import { run } from './run';
/**
* @typedef {import("../generated/api").CartDeliveryOptionsTransformRunResult} CartDeliveryOptionsTransformRunResult
*/
describe('delivery customization function', () => {
it('returns no operations without configuration', () => {
const result = run({
deliveryCustomization: {
metafield: null
}
});
const expected = /** @type {CartDeliveryOptionsTransformRunResult} */ ({ operations: [] });
expect(result).toEqual(expected);
});
});
{%- elsif flavor contains "typescript" -%}
import { describe, it, expect } from 'vitest';
import { run } from './run';
import { CartDeliveryOptionsTransformRunResult } from '../generated/api';
describe('delivery customization function', () => {
it('returns no operations without configuration', () => {
const result = run({
deliveryCustomization: {
metafield: null
}
});
const expected: CartDeliveryOptionsTransformRunResult = { operations: [] };
expect(result).toEqual(expected);
});
});
{% endif -%}