Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`replaceEsm` breaks usage of mongo db

オープン
#488 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript, mongodb, node.js

調査の方向性

Start with the linked minimal repository and reproduce the interaction between replaceEsm, imports in beforeEach, and Mongo queries. Compare calls from module A with calls from module C, then confirm the fix by showing that module A's queries return results while its dependency is replaced.

索引モデルが issue の本文から書いたものです。

説明

Description

Using replaceEsm breaks usage of Mongo in the files under test

Issue

See repo for details. I have a module, A with a dependency on another module, B. Module A queries Mongo DB. When testing module A, I call replaceEsm('path/to/B') and this causes all queries to Mongo in module A to return nothing. However, I also have another module C which also queries Mongo. If I make calls to module C from the tests of module A, the mongo queries work as expected.

It seems there might be an issue with replaceEsm + imports in beforeEach + mongo db.

Environment
  • node -v output: v17.6.0
  • npm -v (or yarn --version) output: 8.5.1
  • npm ls testdouble (or yarn list testdouble) version:
    example@ /Users/paymahn/code/tripvector/example
    └── [email protected]
Example Repo

Here's a minimal repo: https://github.com/paymog/testdouble-example

主要言語
JavaScript
スター
1.4k
フォーク
140
平均マージ
5時間 55分
マージ済み PR(30日)
4

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

testdouble/testdouble.js のほかの issue

testdouble/testdouble.js の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。