---
title: "Discussion on \"How to mock mssql in NodeJS using Jest\" | Hashnode"
description: "Discussion on \"How to mock mssql in NodeJS using Jest\". To mock MSSQL you need to mock the mssql npm module, then create mock implementations of connection, query, close and any other functions that you use."
url: "https://hashnode.com/posts/how-to-mock-mssql-in-nodejs-using-jest/62d15e4220797904269d6cdd"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to mock mssql in NodeJS using Jest](https://alexchadwick.hashnode.dev/how-to-mock-mssql-in-nodejs-using-jest?utm_source=hashnode&utm_medium=feed)

To mock MSSQL you need to mock the mssql npm module, then create mock implementations of connection, query, close and any other functions that you use.

Jul 15, 2022 · 2 min read · alexchadwick.hashnode.dev  
Read the article

-   [#sql-server](https://hashnode.com/tag/sql-server)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#jest](https://hashnode.com/tag/jest)
-   [#mssql](https://hashnode.com/tag/mssql)

## Written by

[Alex Chadwick](https://hashnode.com/@alexchadwick)

@alexchadwick

  
[View profile](https://hashnode.com/@alexchadwick)

I'm a TypeScript developer working in the private mental healthcare sector

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
