angular-redux / store

Angular 2+ bindings for Redux
MIT License
1.34k stars 202 forks source link

Revamp build system #474

Closed aminpaks closed 6 years ago

aminpaks commented 6 years ago

Okay, so I revamped the build with rollup. This will result of shipping the @angular-redux/store with CommonJs, ES5 and ES6.

For some reason one of the test is failing. Not sure why cause I didn't change any logic of components! I tried to understand the logic of that unit-test, but there are too much stuff going on and I'm not sure what's what. So I ended up not being able to fix it.

I believe this PR will bring some values.

And by the way we should get rid of @angular/compiler, cause typescript-library-bundler has a dependency of that.

Would you take a look?

e-schultz commented 6 years ago

Thanks for the PR, taking a look into the testing issue.

@SethDavenport any ideas? noticed also for the select$ test - the second stub never excutes

fit('should reset stubs used by @select$', (done: Function) => {
    const instance = TestBed
      .createComponent(TestComponent)
      .debugElement
      .componentInstance;

    const stub1 = MockNgRedux.getSelectorStub('bar');
    stub1.next(1)
    stub1.next(2);
    stub1.complete();

    instance.barTimesTwo$
      .toArray()
      .subscribe((values: number[]) => expect(values).toEqual([2, 4]));

    MockNgRedux.reset();

    // Reset should result in a new stub getting created.
    const stub2 = MockNgRedux.getSelectorStub('bar');
    expect(stub1 === stub2).toBe(false)

    stub2.next(3);
    stub2.complete();

    instance.obs$
      .toArray()
      .subscribe((values: number[]) => {
        expect(values).toEqual([6])
        done(); // this never gets hit 
      }
      );
  });