feathers-plus/generator-feathers-plus

Authentication Tests for TypeScript projects cannot run

deskoh opened this issue · 3 comments

Steps to reproduce

Generate TypeScript app with local authentication and authentication base test.

Expected behavior

Test should pass.

Actual behavior

Authentication tests fails as app.ts cannot be loaded in authentication.base.js (code)

  1) Test authentication.base.js
       Test socketio transport
         "before all" hook for "Check this test may not seed data":
     TypeError: app.listen is not a function
      at Context.<anonymous> (node_modules\@feathers-plus\test-utils\lib\cli\authentication.base.js:87:24)

  2) Test authentication.base.js
       Test socketio transport
         "after all" hook:
     TypeError: Cannot read property 'close' of undefined
      at Context.<anonymous> (node_modules\@feathers-plus\test-utils\lib\cli\authentication.base.js:104:18)

  3) Test authentication.base.js
       Test rest transport
         "before all" hook:
     TypeError: app.listen is not a function
      at Context.<anonymous> (node_modules\@feathers-plus\test-utils\lib\cli\authentication.base.js:87:24)

  4) Test authentication.base.js
       Test rest transport
         "after all" hook:
     TypeError: Cannot read property 'close' of undefined
      at Context.<anonymous> (node_modules\@feathers-plus\test-utils\lib\cli\authentication.base.js:104:18)

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working):

NodeJS version: v10.13.0

Operating System: Windows

feathers-plus-cli: 0.8.7

Thanks for pointing this out. It would help if you could propose what the correct generated code should be.

@NickBolles @lukeburpee ^^^

Tried adding the following after L85, app can be imported on my configuration.

if (genSpecs.options.ts) app = app.default;

Created PR feathers-plus/test-utils#1 for review.

Published f+/test-utils v0.3.6. Please update your node_modules for existing projects.