Add vitest as test framework and remove jest and its dependencies

This commit is contained in:
RcleydsonR
2023-01-24 22:23:15 -03:00
parent 8b5ba69267
commit 6b8bbc9e6a
8 changed files with 152 additions and 45 deletions

View File

@@ -27,8 +27,8 @@ const getProviderUrl = (): string => {
const etherStore = useEtherStore();
const possibleProvidersUrls: { [key: string]: string } = {
Ethereum: process.env.VITE_GOERLI_API_URL ? process.env.VITE_GOERLI_API_URL : "",
Polygon: process.env.VITE_MUMBAI_API_URL ? process.env.VITE_MUMBAI_API_URL : "",
Ethereum: import.meta.env.VITE_GOERLI_API_URL,
Polygon: import.meta.env.VITE_MUMBAI_API_URL,
};
return possibleProvidersUrls[etherStore.networkName];

View File

@@ -11,11 +11,11 @@ const getNetworksLiquidity = async (): Promise<void> => {
console.log("Loading events");
const goerliProvider = new ethers.providers.JsonRpcProvider(
process.env.VITE_GOERLI_API_URL,
import.meta.env.VITE_GOERLI_API_URL,
5
); // goerli provider
const mumbaiProvider = new ethers.providers.JsonRpcProvider(
process.env.VITE_MUMBAI_API_URL,
import.meta.env.VITE_MUMBAI_API_URL,
80001
); // mumbai provider
@@ -54,6 +54,7 @@ const getValidDeposits = async (
const filterDeposits = p2pContract.filters.DepositAdded(null);
const eventsDeposits = await p2pContract.queryFilter(filterDeposits);
console.log(eventsDeposits);
if(!contract) p2pContract = getContract(); // get metamask provider contract

View File

@@ -5,7 +5,7 @@ import ManageBidsView from "../views/ManageBidsView.vue";
import SellerView from "@/views/SellerView.vue";
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: "/",

View File

@@ -8,7 +8,7 @@ const defaultConfig = {
const api = axios.create({
...defaultConfig,
baseURL: process.env.VITE_API_URL,
baseURL: import.meta.env.VITE_API_URL,
});
export default api;