SShortSingh.
Back to feed

Five breaking differences to know before migrating from Jest to Vitest

0
·1 views

Vitest offers a largely Jest-compatible API, but several key differences can cause unexpected test failures during migration. Unlike Jest, Vitest does not inject globals like describe and expect by default, requiring either explicit imports or a config change. Path aliases must move from moduleNameMapper into Vite's resolver, mock hoisting behavior differs and no longer supports Jest's mockFoo naming convention, and mock restoration settings such as restoreMocks must be explicitly configured. Additionally, Vitest does not bundle a DOM environment, so jsdom must be installed separately — though it can be applied per file, a flexibility Jest lacked. Running the full test suite before modifying any test files helps isolate failures by category, making the migration more manageable.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Why Data Engineering Borrows Its Best Lessons from Ancient Roman Plumbing

A technical essay draws a detailed parallel between modern data engineering and ancient Roman aqueduct infrastructure, arguing the comparison goes well beyond a casual joke. Roman engineers built directional, multi-stage water networks that functionally mirror the directed acyclic graphs used in today's ETL pipelines, with both systems sharing the same core constraint: flow cannot loop back without causing failure. Just as aqueduct crews divided labor among surveyors, stone cutters, and hydraulic specialists, modern data platform teams split responsibilities across ingestion, transformation, orchestration, and serving layers. The essay highlights resumable pipelines — which use offset tracking to restart from a known checkpoint after failure — as the data equivalent of a plumber's shutoff valve or cleanout fitting. It concludes that most real data engineering work, like plumbing, involves diagnosing undocumented legacy systems rather than building clean infrastructure from scratch.

0
ProgrammingDEV Community ·

DuckDB's VSS Extension Brings HNSW Vector Search Without a Separate Database

DuckDB's official VSS extension enables approximate nearest neighbor search directly within the analytics engine, eliminating the need for dedicated vector databases like Pinecone or Qdrant. The extension implements the HNSW algorithm — the same graph-based approach used by most production vector search systems — operating on DuckDB's fixed-size ARRAY columns. Users can install it with two SQL commands, create an HNSW index on an embedding column, and run standard ORDER BY queries that DuckDB automatically routes through the index. The extension supports multiple distance metrics including Euclidean, cosine, and inner product, making it suitable for RAG pipelines and semantic search using models from OpenAI or Sentence-Transformers. Because the vector index lives in the same process as the SQL engine, no separate service or network infrastructure is required.

0
ProgrammingDEV Community ·

Developer finds AI-assisted auto-merge gate passed all checks without running any code

A developer using Claude Code to commit directly to repositories discovered that their automated verify gate was approving pull requests without executing a single check. The gate script fell back to an empty default configuration for three of four repos, causing it to exit with a success code and trigger automatic merges. Auditing revealed further issues in the one nominally gated repo, including a tsconfig that excluded 51 core files from typechecking and a test glob pattern that missed all .tsx test files. The root structural flaw was that an empty or missing gate configuration was treated as a passing result rather than an error. The developer has since recommended that empty gate steps should exit non-zero, missing config keys should break the build, and teams using AI agents to commit code should deliberately break a file to verify their safety gates actually fail.

0
ProgrammingDEV Community ·

MockEvalio's RAG Pipeline Broke Hours After Launch Due to Embedding Endpoint Failure

On March 10, a retrieval-augmented generation (RAG) pipeline for MockEvalio was deployed, capable of parsing job descriptions and generating interview questions using chunked embeddings stored in a pgvector database. Just hours after launch, the embedding step failed when Groq's nomic-embed-text-v1.5 endpoint returned a 404 error at 22:57, halting the pipeline. The fix involved swapping Groq's embedding endpoint for OpenAI's text-embedding-3-small in a 17-line code change, restoring functionality while preserving the same 768-dimension output. The incident also revealed a silent failure bug in the original code, where a missing API key would return zero-vectors without raising an error, potentially corrupting similarity searches undetected. Separately, a self-hosted faster-whisper transcription service was added the same evening as the default option, replacing cloud APIs, with the stated reason being cost reduction and elimination of external API calls.