skip to Main Content

Javascript – Vitest Mock Factory Never Called

Here is my code: import { it, describe, expect, vi, beforeEach } from 'vitest'; const ClientAuthenticator = require('../src/client-authenticator'); const { ssmClient, getParameterCommand } = require('../src/helpers/aws'); const ssmClientMock = vi.fn(); const getParameterCommandMock = vi.fn(); vi.mock('../src/helpers/aws', () => { return { ssmClient:…

VIEW QUESTION

Javascript – Mock new Date() in Deno

I'm wondering if anyone has been able to implement something like jest.spyOn(global, 'Date').mockImplementation(() => now); inside of Deno. I have looked through the documentation for the mock in the Deno documentation here and I have looked through the mock time…

VIEW QUESTION

Can Reactjs test data endpoints?

Here I want to test the data output on the endpoint. My test: import { render, screen } from "@testing-library/react"; import axios from "axios"; import CompBuildingGeo from "./components/CompBuildingGeo"; import { getBuildingGEO } from "../../service/building"; const buildingGeo = async () =>…

VIEW QUESTION
Back To Top
Search