fix tests

This commit is contained in:
Phillip Thelen
2025-05-29 14:31:16 +02:00
parent bc77c7698f
commit 0a6f138de8
3 changed files with 22 additions and 26 deletions

View File

@@ -150,7 +150,7 @@ describe('emails', () => {
sendTxn(mailingInfo, emailType);
expect(got.post).to.be.called;
expect(got.post).to.be.calledWith('undefined/job', sinon.match({
expect(got.post).to.be.calledWith('http://example.com/job', sinon.match({
json: {
data: {
emailType: sinon.match.same(emailType),
@@ -234,7 +234,7 @@ describe('emails', () => {
sendTxn(mailingInfo, emailType);
expect(got.post).to.be.called;
expect(got.post).to.be.calledWith('undefined/job', sinon.match({
expect(got.post).to.be.calledWith('http://example.com/job', sinon.match({
json: {
data: {
emailType: sinon.match.same(emailType),
@@ -254,7 +254,7 @@ describe('emails', () => {
sendTxn(mailingInfo, emailType, variables);
expect(got.post).to.be.called;
expect(got.post).to.be.calledWith('undefined/job', sinon.match({
expect(got.post).to.be.calledWith('http://example.com/job', sinon.match({
json: {
data: {
variables: sinon.match(value => value[0].name === 'BASE_URL', 'matches variables'),

View File

@@ -2,7 +2,6 @@ import got from 'got';
import nconf from 'nconf';
import logger from './logger';
const IS_PROD = nconf.get('IS_PROD');
const EMAIL_SERVER = {
url: nconf.get('EMAIL_SERVER_URL'),
auth: {
@@ -12,7 +11,6 @@ const EMAIL_SERVER = {
};
export function sendJob (type, config) {
if (IS_PROD) {
const { data, options } = config;
const usedOptions = {
backoff: { delay: 10 * 60 * 1000, type: 'exponential' },
@@ -32,6 +30,4 @@ export function sendJob (type, config) {
}).json().catch(err => logger.error(err, {
extraMessage: 'Error while sending an email.',
}));
}
return null;
}