Message from JavaScript discussions

September 2018

— Post code?


Var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var nodemailer = require('nodemailer');

// Create application/x-www-form-urlencoded parser
var urlencodedParser = bodyParser.urlencoded({ extended: false })

app.use(express.static('static_content'));'/es/enviar', urlencodedParser, function (req, res) {
const output = `
<p>You have a new contact request</p>
<h3>Contact Details</h3>
<li>Name: ${}</li>
<li>Email: ${}</li>
<li>Subject: ${req.body.subject}</li>

// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({

auth: {
user: process.env.EMAIL_USER, // generated ethereal user
pass: process.env.EMAIL_PASSWORD/ // generated ethereal password
tls: {
rejectUnauthorized: false

// setup email data with unicode symbols
let mailOptions = {
from: '"Nodemailer Contact" <>', // sender address
to: '', // list of receivers
subject: 'Node Contact Request', // Subject line
text: 'Hello world?', // plain text body
html: output // html body

// send mail with defined transport object
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.log(error);
console.log('Message sent: %s', info.messageId);
console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));

res.render('contact', { msg: 'Email has been sent' });

app.listen(8080, () => console.log('Server started...'));

— Maybe your browser is hitting the endpoint twice?

— I don't know, it ends after sending the second email

— Server started...
Message sent: <>
Preview URL: false
Message sent: <>
Preview URL: false

Message permanent page

— Those are the messages

— Hey guys, im working mainly with react at the moment, i wanted to test my components for a while now...
i use redux in a lot of components (i know keep components stupid & pure as possible, i keep my eye on that).
even thinking of testing the components is a overkill, mocking all the server data first and then writing test cases 🤷‍♂️

Message permanent page

— How would ya'll approach that?

— I debug with marvelous chrome debugger tool. using debugger keyword primarily.

— Ok but is component testing possible with that?

— How would you verify tests?

— You would only be able to check that components contain the correct data, not how they look or behave

Message permanent page