Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

TypeError 'Class constructors cannot be invoked without \'new\'' running test #3

Open
charleskoehl opened this issue Nov 28, 2017 · 0 comments

Comments

@charleskoehl
Copy link

I have been getting this error when trying to use module:

TypeError: Class constructor MailAdapter cannot be invoked without 'new'

so I cloned and tried running the tests, but get similar errors. (The current version of parse-server-mailgun tests fine on the same machine and version of node. I have tried node 5, 6, 7, 8)

npm test

  AmazonSESAdapter
    creating a new instance
      1) should fail if not called with required options
      2) should fail without properly configured templates option
       should succeed with properly configured templates option
    #sendPasswordResetEmail()
      3) should invoke #_sendMail() with the correct arguments
    #sendVerificationEmail()
      4) should invoke #_sendMail() with the correct arguments
    #sendCustomEmail()
      5) should invoke #_sendMail() with the correct arguments


  1 passing (144ms)
  5 failing

  1) AmazonSESAdapter creating a new instance should fail if not called with required options:

      AssertionError: expected 'Class constructors cannot be invoked without \'new\'' to equal 'AmazonSESAdapter requires valid fromAddress, accessKeyId, secretAccessKey, region.'
      + expected - actual

      -Class constructors cannot be invoked without 'new'
      +AmazonSESAdapter requires valid fromAddress, accessKeyId, secretAccessKey, region.

      at Context.<anonymous> (test/testAmazonSESAdapter.js:55:41)

  2) AmazonSESAdapter creating a new instance should fail without properly configured templates option:

      AssertionError: expected 'Class constructors cannot be invoked without \'new\'' to equal 'AmazonSESAdapter templates are not properly configured.'
      + expected - actual

      -Class constructors cannot be invoked without 'new'
      +AmazonSESAdapter templates are not properly configured.

      at Context.<anonymous> (test/testAmazonSESAdapter.js:84:34)

  3) AmazonSESAdapter #sendPasswordResetEmail() should invoke #_sendMail() with the correct arguments:
     TypeError: Class constructors cannot be invoked without 'new'
      at AmazonSESAdapter.MailAdapter (node_modules/parse-server/lib/Adapters/Email/MailAdapter.js:11:1)
      at new AmazonSESAdapter (src/AmazonSESAdapter.js:14:29)
      at Context.<anonymous> (test/testAmazonSESAdapter.js:222:23)

  4) AmazonSESAdapter #sendVerificationEmail() should invoke #_sendMail() with the correct arguments:
     TypeError: Class constructors cannot be invoked without 'new'
      at AmazonSESAdapter.MailAdapter (node_modules/parse-server/lib/Adapters/Email/MailAdapter.js:11:1)
      at new AmazonSESAdapter (src/AmazonSESAdapter.js:14:29)
      at Context.<anonymous> (test/testAmazonSESAdapter.js:259:23)

  5) AmazonSESAdapter #sendCustomEmail() should invoke #_sendMail() with the correct arguments:
     TypeError: Class constructors cannot be invoked without 'new'
      at AmazonSESAdapter.MailAdapter (node_modules/parse-server/lib/Adapters/Email/MailAdapter.js:11:1)
      at new AmazonSESAdapter (src/AmazonSESAdapter.js:14:29)
      at Context.<anonymous> (test/testAmazonSESAdapter.js:295:23)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant