sneakyfishies
sneakyfishies

Reputation: 181

Issues with importing a library in nim test file

I'm having some issues including a library in a nim test file.

My code in my test file looks like this.

import unittest
import testToolpkg/Login
import dotenv
load()

test "valid login cookies":
  var cookies = loginCookies(os.get("EMAIL"), os.get("PASSWORD"), os.get("URL"))
  check cookies.len != 0

However when I run nimble test I get this error Error: cannot open file: dotenv. This seems to be an issue with any external library I try to use in a test.

The dotenv library works fine outside of the tests folder. I'm not sure if I'm missing some kind of option to get this to work? I am running this on windows as well.

Upvotes: 0

Views: 468

Answers (1)

sneakyfishies
sneakyfishies

Reputation: 181

After adding the lib to my .nimble file

requires "dotenv >= 2.0.0"

The issue was resolved!

Upvotes: 3

Related Questions