medusa
medusa copied to clipboard
feat(medusa): convert services/__tests__/total test to ts
There is no issue for this - it's part of updating the code base to typescript.
This PR contains the changes for moving packages/medusa/src/services/__tests__/totals.js
to typescript.
Is this PR a generally good pattern to use for changing the rest of the tests to typescript?
Is the repositories/__mocks__/xxx.ts
file a good place to put the xxxRepositoryMock functions or should they be moved elsewhere?
Test Suites: 172 passed, 172 total
Tests: 936 passed, 936 total
Snapshots: 4 passed, 4 total
Time: 60.832s
Ran all test suites.
Full Test Results
```PASS src/api/routes/admin/discounts/tests/list-discounts.js (9.576s) PASS src/api/routes/store/customers/tests/create-customer.js (9.806s) PASS src/api/routes/store/regions/tests/list-regions.js (9.926s) PASS src/api/routes/store/variants/tests/list-variants.js (10.029s) PASS src/api/routes/admin/discounts/tests/delete-discount.js (10.075s) PASS src/api/routes/admin/invites/tests/create-invite.js (10.156s) PASS src/api/routes/admin/store/tests/get-store.js (10.153s) PASS src/api/routes/admin/products/tests/create-product.js (10.29s) PASS src/api/routes/admin/price-lists/tests/delete-prices-batch.ts (10.326s) PASS src/api/routes/store/variants/tests/get-variant.js (10.216s) PASS src/api/routes/admin/discounts/tests/create-discount.js (10.621s) PASS src/services/tests/totals.ts PASS src/api/routes/admin/price-lists/tests/get-price-list.ts PASS src/api/routes/admin/customer-groups/tests/get-customer-group.ts PASS src/api/routes/admin/price-lists/tests/add-prices-batch.ts PASS src/api/routes/store/carts/tests/update-cart.js PASS src/api/routes/admin/shipping-options/tests/delete-shipping-option.js PASS src/api/routes/store/carts/tests/add-shipping-method.js PASS src/api/routes/admin/orders/tests/return-order.js PASS src/api/routes/store/customers/tests/update-customer.js PASS src/api/routes/store/carts/tests/create-cart.js PASS src/api/routes/admin/store/tests/add-currency.js PASS src/api/routes/admin/users/tests/update-user.js PASS src/api/routes/admin/orders/tests/create-claim.js PASS src/api/routes/store/shipping-options/tests/list-shipping-options.js PASS src/api/routes/admin/products/tests/list-products.js PASS src/api/routes/admin/swaps/tests/get-swap.js PASS src/api/routes/admin/orders/tests/cancel-order.js PASS src/api/routes/admin/users/tests/list-users.js PASS src/api/routes/admin/orders/tests/capture-payment.js PASS src/api/routes/admin/regions/tests/get-region.js PASS src/api/routes/store/carts/tests/get-cart.js PASS src/api/routes/admin/orders/tests/cancel-swap.js PASS src/api/routes/admin/orders/tests/cancel-claim.js PASS src/api/routes/admin/shipping-options/tests/update-shipping-option.js PASS src/api/routes/admin/shipping-options/tests/get-shipping-options.js PASS src/api/routes/admin/sales-channels/tests/list-sales-channels.js PASS src/api/routes/store/carts/tests/create-line-item.js PASS src/api/routes/admin/shipping-profiles/tests/list-shipping-profiles.js PASS src/api/routes/admin/products/tests/update-product.js PASS src/api/routes/store/carts/tests/update-payment-session.js PASS src/api/routes/admin/collections/tests/delete-collection.js PASS src/api/routes/admin/products/tests/add-option.js PASS src/api/routes/admin/users/tests/create-user.js PASS src/api/routes/admin/regions/tests/list-regions.js PASS src/api/routes/admin/regions/tests/remove-payment-provider.js PASS src/api/routes/store/carts/tests/update-line-item.js PASS src/api/routes/admin/orders/tests/archive-order.js PASS src/api/routes/admin/shipping-options/tests/create-shipping-option.js PASS src/api/routes/admin/shipping-profiles/tests/get-shipping-profile.js PASS src/api/routes/admin/regions/tests/delete-region.js PASS src/api/routes/admin/collections/tests/list-collections.js PASS src/api/routes/admin/products/tests/create-variant.js PASS src/api/routes/admin/sales-channels/tests/delete-products-batch.ts PASS src/api/routes/admin/orders/tests/cancel-fulfillment-swap.js PASS src/api/routes/admin/products/tests/delete-variant.js PASS src/api/routes/store/shipping-options/tests/list-options.js PASS src/api/routes/admin/users/tests/reset-password.js PASS src/api/routes/admin/collections/tests/update-collection.js PASS src/api/routes/admin/price-lists/tests/delete-price-list.ts (5.163s) PASS src/api/routes/admin/discounts/tests/update-discount.js PASS src/api/routes/admin/store/tests/update-store.js PASS src/api/routes/store/customers/tests/reset-password.js (5.094s) PASS src/api/routes/store/carts/tests/complete-cart.js PASS src/api/routes/admin/discounts/tests/add-region.js (5.151s) PASS src/api/routes/admin/collections/tests/get-collection.js (5.276s) PASS src/api/routes/admin/products/tests/delete-option.js PASS src/api/routes/admin/returns/tests/receive-return.js PASS src/api/routes/admin/regions/tests/remove-country.js PASS src/api/routes/admin/products/tests/get-product.js PASS src/api/routes/admin/discounts/tests/get-discount.js PASS src/api/routes/admin/users/tests/reset-password-token.js PASS src/api/routes/store/collections/tests/get-collection.js PASS src/api/routes/admin/sales-channels/tests/add-product-batch.ts PASS src/api/routes/admin/regions/tests/add-fulfillment-provider.js PASS src/api/routes/store/products/tests/search.js PASS src/api/routes/admin/orders/tests/get-order.js PASS src/api/routes/admin/price-lists/tests/list-price-lists.ts PASS src/loaders/tests/plugins.spec.ts PASS src/api/routes/admin/regions/tests/remove-fulfillment-provider.js PASS src/strategies/tests/batch-jobs/product/export.ts PASS src/api/routes/admin/sales-channels/tests/delete-sales-channel.ts PASS src/api/routes/admin/shipping-profiles/tests/update-shipping-profile.js PASS src/api/routes/admin/users/tests/get-user.js PASS src/api/routes/admin/sales-channels/tests/create-sales-channel.ts PASS src/api/routes/admin/products/tests/list-variants.js PASS src/api/routes/admin/orders/tests/update-order.js PASS src/api/routes/admin/invites/tests/accept-invite.js PASS src/api/routes/admin/products/tests/update-variant.js PASS src/api/routes/admin/store/tests/remove-currency.js PASS src/api/routes/admin/collections/tests/remove-products.js PASS src/api/routes/admin/shipping-options/tests/list-shipping-options.js PASS src/api/routes/store/carts/tests/refresh-payment-session.js PASS src/api/routes/store/products/tests/get-product.js PASS src/api/routes/store/carts/tests/create-payment-sessions.js PASS src/api/routes/admin/regions/tests/create-region.js PASS src/api/routes/admin/orders/tests/cancel-fulfillment.js PASS src/api/routes/admin/sales-channels/tests/update-sales-channel.ts PASS src/api/routes/admin/collections/tests/create-collection.js PASS src/api/routes/store/collections/tests/list-collections.js PASS src/services/tests/order.js PASS src/api/routes/store/customers/tests/reset-password-token.js PASS src/api/routes/store/orders/tests/get-order.js PASS src/api/routes/store/regions/tests/get-region.js PASS src/api/routes/admin/invites/tests/resend-invite.js PASS src/api/routes/admin/regions/tests/update-region.js PASS src/api/routes/admin/price-lists/tests/update-price-list.ts PASS src/api/routes/admin/customer-groups/tests/create-customer-group.ts PASS src/api/routes/admin/shipping-profiles/tests/create-shipping-profile.js PASS src/api/routes/store/products/tests/list-products.js PASS src/api/routes/admin/shipping-profiles/tests/delete-shipping-profile.js PASS src/api/routes/store/orders/tests/get-order-by-cart.js PASS src/api/routes/admin/orders/tests/cancel-fulfillment-claim.js PASS src/api/routes/admin/regions/tests/add-country.js PASS src/api/routes/admin/orders/tests/create-fulfillment.js PASS src/api/routes/admin/collections/tests/add-products.js PASS src/api/routes/admin/products/tests/delete-product.js PASS src/api/routes/admin/products/tests/update-option.js PASS src/api/routes/admin/price-lists/tests/create-price-list.ts PASS src/api/routes/admin/swaps/tests/list-swaps.js PASS src/api/routes/admin/regions/tests/add-payment-provider.js PASS src/api/routes/store/orders/tests/lookup-order.js PASS src/services/tests/claim.js PASS src/services/tests/claim-item.js PASS src/api/routes/admin/users/tests/delete-user.js PASS src/api/routes/admin/sales-channels/tests/get-sales-channel.ts PASS src/strategies/tests/batch-jobs/order/order-export.ts PASS src/services/tests/discount.js PASS src/services/tests/price-list.js PASS src/services/tests/store.js PASS src/services/tests/batch-job.ts PASS src/api/routes/admin/discounts/tests/remove-region.js PASS src/services/tests/gift-card.js PASS src/services/tests/custom-shipping-option.js PASS src/services/tests/note.js PASS src/services/tests/tax-provider.js PASS src/services/tests/cart.js PASS src/services/tests/user.js PASS src/services/tests/customer.js PASS src/services/tests/auth.js PASS src/services/tests/notification.js PASS src/services/tests/fulfillment.js PASS src/services/tests/draft-order.js PASS src/services/tests/product-variant.js PASS src/services/tests/event-bus.js PASS src/services/tests/product-collection.js PASS src/services/tests/invite.js PASS src/services/tests/sales-channel.ts PASS src/services/tests/shipping-option.js PASS src/services/tests/swap.js PASS src/services/tests/region.js PASS src/services/tests/shipping-profile.js PASS src/services/tests/inventory.js PASS src/services/tests/product.js PASS src/services/tests/csv-parser.js PASS src/services/tests/middleware.js PASS src/strategies/tests/price-selection.js PASS src/services/tests/system-tax.js PASS src/interfaces/tests/transaction-base-service.spec.ts PASS src/utils/tests/remove-undefined-properties.spec.ts PASS src/utils/tests/build-query.spec.ts PASS src/utils/tests/format-registration-name.js PASS src/services/tests/return.js PASS src/services/tests/line-item-adjustment.js PASS src/strategies/tests/cart-completion.js PASS src/utils/tests/generate-entity-id.ts PASS src/loaders/tests/default.spec.ts ● Console
console.log
{"level":"info","message":"Using flag sales_channels from project config with value true","timestamp":"2022-08-05 00:18:26"}
at Console.log (../../node_modules/winston/lib/winston/transports/console.js:79:23)
PASS src/services/tests/line-item.js PASS src/services/tests/payment-provider.js PASS src/strategies/tests/tax-calculation.js PASS src/utils/tests/flag-router.ts PASS src/loaders/tests/feature-flags.spec.ts
Test Suites: 172 passed, 172 total Tests: 936 passed, 936 total Snapshots: 4 passed, 4 total Time: 60.832s Ran all test suites.
</details>
🦋 Changeset detected
Latest commit: 072965c8cb4224fc6152591130f60fd5f90d251c
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
Name | Type |
---|---|
@medusajs/medusa | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR