spacefill / gibbon-mail

Send mails with mjml Template and JSON Schema
3 stars 1 forks source link

Add backend validations #24

Closed Its-Alex closed 3 years ago

Its-Alex commented 3 years ago

Closes #25

What's missing:

- [x] Tests

What is done in this pull request:

Its-Alex commented 3 years ago

@stephane-klein Need review

stephane-klein commented 3 years ago

@Its-Alex issue: I have this error:

$ direnv allow
$ cd backend
$ yarn run test
yarn run v1.22.10
$ eslint --ignore-path .gitignore .
$ jest
  ●  process.exit called with "1"

      315 |                 console.error(error);
      316 |                 console.error('Smtp url:', getSmtpUrl());
    > 317 |                 process.exit(1);
          |                         ^
      318 |             } else {
      319 |                 console.log('Smtp server is ready to take our messages');
      320 |             }

      at src/app.js:317:25
      at SMTPConnection.<anonymous> (node_modules/nodemailer/lib/smtp-transport/index.js:346:24)
      at SMTPConnection._onError (node_modules/nodemailer/lib/smtp-connection/index.js:764:14)
      at Socket.SMTPConnection._onSocketError (node_modules/nodemailer/lib/smtp-connection/index.js:190:45)

 RUNS  test/routes.test.js
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Its-Alex commented 3 years ago

@Its-Alex issue: I have this error:

$ direnv allow
$ cd backend
$ yarn run test
yarn run v1.22.10
$ eslint --ignore-path .gitignore .
$ jest
  ●  process.exit called with "1"

      315 |                 console.error(error);
      316 |                 console.error('Smtp url:', getSmtpUrl());
    > 317 |                 process.exit(1);
          |                         ^
      318 |             } else {
      319 |                 console.log('Smtp server is ready to take our messages');
      320 |             }

      at src/app.js:317:25
      at SMTPConnection.<anonymous> (node_modules/nodemailer/lib/smtp-transport/index.js:346:24)
      at SMTPConnection._onError (node_modules/nodemailer/lib/smtp-connection/index.js:764:14)
      at Socket.SMTPConnection._onSocketError (node_modules/nodemailer/lib/smtp-connection/index.js:190:45)

 RUNS  test/routes.test.js
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@stephane-klein You must start at least one mailcatcher instance to run tests, this is a weird bug that has always been here

stephane-klein commented 3 years ago

You must start at least one mailcatcher instance to run tests, this is a weird bug that has always been here

Fixed by https://github.com/spacefill/gibbon-mail/commit/12e9f314bddb00ba59a810a14d145b460c756717