8000 [dove/cli] Address strictNullCheck error on app.test.ts by FossPrime · Pull Request #2466 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content

[dove/cli] Address strictNullCheck error on app.test.ts#2466

Merged
daffl merged 1 commit intofeathersjs:hygen-clifeathersjs/feathers:hygen-clifrom
FossPrime:patch-10
Oct 12, 2021
Merged

[dove/cli] Address strictNullCheck error on app.test.ts#2466
daffl merged 1 commit intofeathersjs:hygen-clifrom
FossPrime:patch-10

Conversation

@FossPrime
Copy link
Member

Strict null checks are on in our tsconfig.json... so we run into the following error without this PR.
https://stackoverflow.com/a/58401023/370238

https://codesandbox.io/s/feathers-dove-cs7qc?file=/test/app.test.ts

Before PR:

test/app.test.ts:36:28 - error TS2532: Object is possibly 'undefined'.

36         assert.strictEqual(response.data.name, 'NotFound')
                              ~~~~~~~~

After PR:


  Feathers application tests
    ✔ starts and shows the index page (44ms)
    ✔ shows a 404 JSON error

  'messages' service
    ✔ registered the service


  3 passing (54ms)

Summary

(If you have not already please refer to the contributing guideline as described
here
)

  • Tell us about the problem your pull request is solving.
  • Are there any open issues that are related to this?
  • Is this PR dependent on PRs in other repos?

Strict null checks are on in our tsconfig.json... so we run into the following error without this PR.
https://stackoverflow.com/a/58401023/370238

```
test/app.test.ts:36:28 - error TS2532: Object is possibly 'undefined'.

36         assert.strictEqual(response.data.name, 'NotFound')
                              ~~~~~~~~
```
@daffl daffl merged commit b214d34 into feathersjs:hygen-cli Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0