These are chat archives for ngUpgraders/ng-forward

2nd
Nov 2015
Aleh Kashnikau
@mkusher
Nov 02 2015 01:01
using babel5(webpack+babel-loader stage=1) I'm getting
ERROR in ./~/ng-forward/dist/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./decorators/providers/injectable in ./node_modules/ng-forward/dist
 @ ./~/ng-forward/dist/index.js 41:37-81

ERROR in ./~/ng-forward/dist/classes/provider.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../decorators/providers/injectable in ./node_modules/ng-forward/dist/classes
 @ ./~/ng-forward/dist/classes/provider.js 31:37-82

ERROR in ./~/ng-forward/dist/util/get-injectable-name.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../decorators/providers/injectable in ./node_modules/ng-forward/dist/util
 @ ./~/ng-forward/dist/util/get-injectable-name.js 13:37-82
Tim Kindberg
@timkindberg
Nov 02 2015 01:02
Try Stage 0
Aleh Kashnikau
@mkusher
Nov 02 2015 01:04
no, it didn't helped. However, in dist/decorators/providers there is no injectable.js, but there is an Injectable.js
and when I manually changed require(...injectable.js) to Injectable.js build went ok
how do anyone use it? webpack/browserify/jspm? babel or typescript?
Brandon
@brandonroberts
Nov 02 2015 01:23
@mkusher I've used it with browsersify and babel
@mkusher the playground example app uses browserify and babel also
Yves Serrano
@yvess
Nov 02 2015 07:47
@mkusher I use jspm and babel
Aleh Kashnikau
@mkusher
Nov 02 2015 08:16
os x?
Yves Serrano
@yvess
Nov 02 2015 08:53
@mkusher yes and no. I use docker in osx, so it runs on my mac in an linux environment. But I also tested the playground in OS X, this worked
Aleh Kashnikau
@mkusher
Nov 02 2015 12:04
@yvess hm, maybe we use different version?
it will work if your fs is case-insensitive
Aleh Kashnikau
@mkusher
Nov 02 2015 12:10
and it looks like travis-ci builds are failing because of typo in name of injectable.js
looks much better :)
Aleh Kashnikau
@mkusher
Nov 02 2015 13:34
ok, temporary marked two tests(in component and in events) as skipped and now travis-ci build is green :)
I need someone's help to fix bubble events error
David Gang
@david-gang
Nov 02 2015 13:35
Hi @timkindberg
Thanks for your comment at ngUpgraders/ng-forward#10
As i understand
With the current test tool you never test a service per se
just through the creation of a component
is this correct?
BTW: May i help with ngUpgraders/ng-forward#31 ?
Is there something i can contribute there ?
Tim Kindberg
@timkindberg
Nov 02 2015 14:05
@mkusher Thanks for contributing. We do have that injectable file fixed in our typescript branch. Though we aren't sure why bubble is broken all of a sudden.
@david-gang #31 is going ok we are fixing typescript errors and other things. I'm not sure there's much you can help with right now other than toying with it and reporting bugs.
Aleh Kashnikau
@mkusher
Nov 02 2015 14:09
@timkindberg ok, hope you will publish new release soon :)
David Gang
@david-gang
Nov 02 2015 14:35
Thanks @timkindberg
Regarding the test tool?
So we test components and services through components
not the services themselves.
is this true
Kasper Lewau
@kasperlewau
Nov 02 2015 15:03

@david-gang Have a look here on how to test services (or, data stores if you will). It’s not restricted/bound by the concepts of Angular when you start working with simple ES6 classes.

https://github.com/kasperlewau/ng-forward-playground/blob/feat/tests/app/services/TodoStore.spec.js

Surely you could test the above in the context/scope of a consumer component, but that doesn’t make a whole lot of sense as far as unit tests go.
David Gang
@david-gang
Nov 02 2015 15:18
HI @kasperlewau
Kasper Lewau
@kasperlewau
Nov 02 2015 15:18
Hi :)
David Gang
@david-gang
Nov 02 2015 15:18
These are plain es6 classes
:-)
What i am looking for is a class where we have dependency injection through the @Inject keyword
Kasper Lewau
@kasperlewau
Nov 02 2015 15:19
Well, the linked class here does indeed make use of the @inject decorator. Or at least, it is open to DI.
It hasn’t actually injected anything at this point.
David Gang
@david-gang
Nov 02 2015 15:20
if i test the class i want that the framework will handle the dependency injection
please take a look at ngUpgraders/ng-forward#10
at the end we have an example written by @timkindberg
The example shows how we construct a component and then fetch the service through the component
my question was if we need to create a component to check the service or we can tell the injector to create the service as a standalone
Kasper Lewau
@kasperlewau
Nov 02 2015 15:27

I think I’m misunderstanding the point of this, what is it that you want to test?

  • A service?
  • A component?
  • A service that has been injected into a component?

I do apologise if I’m being slow here.

Or is it something else entirely?
David Gang
@david-gang
Nov 02 2015 15:29
a service :-)
let's call it TestService
@Injectable
@Inject('$scope',XService,YService)
class TestService() {
constructor(){
}
doSomethingCool() {
....
}
}
Now i want to create TestService and test it
i want the injector to create TestService rather than doing it manually
that's my question
Kasper Lewau
@kasperlewau
Nov 02 2015 15:36
When you say create; Do you mean the instantiation of a new instance of said class, or the registration of TestService as an injectable entity in ‘angular land’?
David Gang
@david-gang
Nov 02 2015 15:58
Hi
in this case i don't need the registration of the TestService
in the angular land
but i want the angular land to create for me the TestService :-)
that's very important with DI frameworks
they make the nasty work for you