# How to add a private unregistered package as a dependency to unit testing?

**URL:** https://discourse.julialang.org/t/how-to-add-a-private-unregistered-package-as-a-dependency-to-unit-testing/89970
**Category:** Package Management
**Created:** [November 9, 2022, 8:29am UTC](https://discourse.julialang.org/t/how-to-add-a-private-unregistered-package-as-a-dependency-to-unit-testing/89970 "2022-11-09T08:29:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![TTolppanen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ttolppanen/32/12568_2.png) [@TTolppanen](https://discourse.julialang.org/u/TTolppanen)
#### Post date: [November 9, 2022, 8:29am UTC](https://discourse.julialang.org/t/how-to-add-a-private-unregistered-package-as-a-dependency-to-unit-testing/89970/1 "2022-11-09T08:29:10Z")

</div>

I’m developing the PkgA and writing some unit tests for it. In the unit tests I want to use the package PkgB to test the code. PkgA does not depend on PkgB, only the unit tests depend on it. PkgB is a private unregistered package that I have been working on recently.

I have tried adding the PkgB to the test environment by using

```julia
(test) pkg> add github.com/ttolppanen... 

```

which adds the package, but when trying to run the tests I get the error

```julia
ERROR: can not merge projects

```

The PkgB works fine by itself, I just can’t get it to work with the unit tests.

So the question is, what is the proper way to add a package as a dependency to the unit tests, when the package is not registered (private, or my own)?

---

<div class="post-metadata">

### Author: ![TTolppanen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ttolppanen/32/12568_2.png) [@TTolppanen](https://discourse.julialang.org/u/TTolppanen)
#### Post date: [November 24, 2022, 8:00am UTC](https://discourse.julialang.org/t/how-to-add-a-private-unregistered-package-as-a-dependency-to-unit-testing/89970/2 "2022-11-24T08:00:18Z")

</div>

You can achieve this by using [LocalRegistry.jl](https://github.com/GunnarFarneback/LocalRegistry.jl). It’s not too bad to setup.
