From 131d871f785ad2c356341042a1c5beff2d4d7514 Mon Sep 17 00:00:00 2001 From: Cody Born Date: Wed, 15 Jan 2025 17:02:48 -0500 Subject: [PATCH] Fix package resolution for E2E test (#507) * Add unichain * fix integ tests * Bump X SDK * Point jest to cjs output --- jest.config.js | 3 +++ test/e2e/order.test.ts | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/jest.config.js b/jest.config.js index 7db54a84..7d62758f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -24,4 +24,7 @@ module.exports = { // https://swc.rs/docs/usage/jest#usage '^.+\\.(t|j)s?$': '@swc/jest', }, + moduleNameMapper: { + '^@uniswap/uniswapx-sdk/dist/cjs/(.*)$': '/node_modules/@uniswap/uniswapx-sdk/dist/cjs/$1' + } } diff --git a/test/e2e/order.test.ts b/test/e2e/order.test.ts index ad962173..140a75fd 100644 --- a/test/e2e/order.test.ts +++ b/test/e2e/order.test.ts @@ -1,20 +1,18 @@ /* eslint-disable jest/no-disabled-tests */ import { DutchOrder, DutchOrderBuilder, REACTOR_ADDRESS_MAPPING, SignedUniswapXOrder, UnsignedV2DutchOrder, V2DutchOrderBuilder } from '@uniswap/uniswapx-sdk' -import { factories } from '@uniswap/uniswapx-sdk/dist/types/src/contracts' import axios from 'axios' import dotenv from 'dotenv' import { BigNumber, Contract, ethers, Wallet } from 'ethers' import { MAX_UINT96, PERMIT2, UNI, WETH, ZERO_ADDRESS } from './constants' import { v4 as uuidv4 } from 'uuid' -const { ExclusiveDutchOrderReactor__factory } = factories - import { UniswapXOrderEntity } from '../../lib/entities' import { AVERAGE_BLOCK_TIME } from '../../lib/handlers/check-order-status/util' import { GetOrdersResponse } from '../../lib/handlers/get-orders/schema/GetOrdersResponse' import { ChainId } from '../../lib/util/chain' import * as ERC20_ABI from './abis/erc20.json' import { stringValue } from 'aws-sdk/clients/iot' +import { ExclusiveDutchOrderReactor__factory } from '@uniswap/uniswapx-sdk/dist/cjs/src/contracts/factories' const { abi } = ERC20_ABI dotenv.config()