componentjs / component

frontend package manager and build tool for modular web applications
https://github.com/componentjs/guide
MIT License
4.55k stars 306 forks source link

How to test local components? #608

Closed vmariano closed 9 years ago

vmariano commented 9 years ago

Hi Folks. I'm working on a extension of node js starter and I would like add some test to the local components.

So, I checked other component projects and I didn't see any implementation of that (mostly projects doesn't use local components).

I was using this possible workarrund (i'm not sure if this is correct or not)

I try to add a test case on to the test folder:

├── app
│   └── menu
│       ├── index.js
│       ├── menu.css
│       ├── template.html
│       └── test
│           └── menuTest.js

Inside of menuTest.js I import index.js but, index.js require other local components.
So, I think is possible import all dependencies one by one, but there is other way to do that?

netpoetica commented 9 years ago

Do you have a repo for this that I could check out?

vmariano commented 9 years ago

No for the moment, but I will create some one.

timaschew commented 9 years ago

I don't get

I think is possible import all dependencies one by one, but there is other way to do that?

and is this a problem for you:?

Inside of menuTest.js I import index.js but, index.js require other local components.

Did you checked out my c8-experiments repo? Here is a commit, where I test a local component: https://github.com/timaschew/c8-experiments/commit/4266bd7c43ed3bcb800f61ef24a9d6b01e9dae22

I have this structure

└─ lib
    ├─ dev-local
    ├─ foobar
    └─ my-component

my-component has a local dependency to foobar and in dev environment it also has dev-local as a dependency

vmariano commented 9 years ago

Thx @timaschew I will take a look.

timaschew commented 9 years ago

So @vmariano did you solve it or you need some help?

vmariano commented 9 years ago

Sorry for the delay, I was working in other issues with more close deadlines. I think I can can close and if i had other issue will be back.

Thanks a lot guys.