mirror of
https://github.com/eleith/emailjs.git
synced 2024-06-30 18:30:58 +00:00
test: use .cb
for everything
This commit is contained in:
parent
5d34773455
commit
23fefeb915
|
@ -38,7 +38,7 @@ const send = (
|
|||
});
|
||||
};
|
||||
|
||||
test.before(() => {
|
||||
test.beforeEach.cb((t) => {
|
||||
server.listen(port, function () {
|
||||
server.onAuth = function (auth, _session, callback) {
|
||||
if (auth.username == 'pooh' && auth.password == 'honey') {
|
||||
|
@ -47,10 +47,11 @@ test.before(() => {
|
|||
return callback(new Error('invalid user / pass'));
|
||||
}
|
||||
};
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test.after(() => server.close());
|
||||
test.afterEach.cb((t) => server.close(t.end));
|
||||
|
||||
test.cb('authorize plain', (t) => {
|
||||
const msg = {
|
||||
|
|
|
@ -36,7 +36,7 @@ const send = (
|
|||
});
|
||||
};
|
||||
|
||||
test.before(() => {
|
||||
test.before.cb((t) => {
|
||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // prevent CERT_HAS_EXPIRED errors
|
||||
|
||||
server.listen(port, function () {
|
||||
|
@ -47,10 +47,11 @@ test.before(() => {
|
|||
return callback(new Error('invalid user / pass'));
|
||||
}
|
||||
};
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test.after(() => server.close());
|
||||
test.after.cb((t) => server.close(t.end));
|
||||
|
||||
test.cb('authorize ssl', (t) => {
|
||||
const msg = {
|
||||
|
|
|
@ -40,7 +40,7 @@ const send = (
|
|||
});
|
||||
};
|
||||
|
||||
test.before(() => {
|
||||
test.before.cb((t) => {
|
||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // prevent CERT_HAS_EXPIRED errors
|
||||
server.listen(port, function () {
|
||||
server.onAuth = function (auth, _session, callback) {
|
||||
|
@ -50,10 +50,11 @@ test.before(() => {
|
|||
return callback(new Error('invalid user / pass'));
|
||||
}
|
||||
};
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test.after(() => server.close());
|
||||
test.after.cb((t) => server.close(t.end));
|
||||
|
||||
test.cb('simple text message', (t) => {
|
||||
const msg = {
|
||||
|
|
Loading…
Reference in New Issue
Block a user