Skip to content
This repository has been archived by the owner on May 23, 2021. It is now read-only.

ngrx-action-hygiene: false positives with .spec.ts files #22

Closed
dsebastien opened this issue Dec 25, 2019 · 3 comments · Fixed by #23
Closed

ngrx-action-hygiene: false positives with .spec.ts files #22

dsebastien opened this issue Dec 25, 2019 · 3 comments · Fixed by #23
Labels
bug Something isn't working released

Comments

@dsebastien
Copy link

I've added this set of rules to my TSLint config, but there seems to be something wrong with my config/setup.

When I run the linting with the recommended settings, and in particular ngrx-action-hygiene, I get errors like these:

ERROR: C:/Users/trankill/wks/didowi/apps/web/src/app/store/reducers.spec.ts:5:10 - Action type does not follow the good action hygiene practice, use "[Source] Event" to define action types
ERROR: C:/Users/trankill/wks/didowi/apps/web/src/app/store/reducers.spec.ts:6:12 - Action type does not follow the good action hygiene practice, use "[Source] Event" to define action types
ERROR: C:/Users/trankill/wks/didowi/apps/web/src/app/store/reducers.spec.ts:7:8 - Action type does not follow the good action hygiene practice, use "[Source] Event" to define action types

The thing is that the pointed out lines correspond to Jest describe and it statements:


describe("application reducers", () => {
  describe("appInit reducers", () => {
    it("should return the initial state", () => {
      let newState = initializationStateReducer(undefined, createAction("[App Tests] Init"));
      expect(newState).toEqual(appInitInitialState);

      newState = initializationStateReducer(undefined, initializeApplication);
      expect(newState).toEqual(appInitInitialState);
    });

Any idea what I'm suppose to do / what could be wrong?
I'm not too keen on excluding the spec.ts files as there might be other linting rules that I could benefit from in my tests.

@timdeschryver
Copy link
Owner

You're not doing anything wrong, it's a bug - thanks for raising this issue.

@timdeschryver
Copy link
Owner

🎉 This issue has been resolved in version 1.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@timdeschryver
Copy link
Owner

Should be fixed, if it's not the case feel free to re-open the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working released
Projects
None yet
2 participants