<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>a4dosanddos</author_name>
  <author_url>https://blog.hatena.ne.jp/a4dosanddos/</author_url>
  <blog_title>プログラム日記</blog_title>
  <blog_url>https://a4dosanddos.hatenablog.com/</blog_url>
  <categories>
    <anon>Node.js</anon>
  </categories>
  <description>Node.jsで開発用とテスト用で接続するデータベースを切り替える方法についての記事です。 テストフレームワークには Jest を利用しています。 Jest · 🃏 Delightful JavaScript Testing 方法としては NODE_ENV という環境変数によって接続先データベースの設定を切り替える方法です。Jest では当該の環境変数に何も設定されていない場合、test が設定される動作になるので、こいつを利用します。 データベースの設定を db.config.js (ファイル名は任意) に以下のように設定します。 development(開発用)、test(テスト用)で設定…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fa4dosanddos.hatenablog.com%2Fentry%2F2022%2F02%2F23%2F161012&quot; title=&quot;Node.jsで開発とテストで接続先のデータベースを切り替える方法 - プログラム日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-02-23 16:10:12</published>
  <title>Node.jsで開発とテストで接続先のデータベースを切り替える方法</title>
  <type>rich</type>
  <url>https://a4dosanddos.hatenablog.com/entry/2022/02/23/161012</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
