mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 19:02:29 +03:00
Fixed tests for @tryghost/email-suppression-list
These were missing and caused the build to fail
This commit is contained in:
parent
cbe1573fd5
commit
9add72ebb1
@ -8,6 +8,7 @@
|
||||
"scripts": {
|
||||
"dev": "echo \"Implement me!\"",
|
||||
"test": "NODE_ENV=testing c8 --all --check-coverage --reporter text --reporter cobertura mocha './test/**/*.test.js'",
|
||||
"test:unit": "yarn test",
|
||||
"lint:code": "eslint *.js lib/ --ext .js --cache",
|
||||
"lint": "yarn lint:code && yarn lint:test",
|
||||
"lint:test": "eslint -c test/.eslintrc.js test/ --ext .js --cache"
|
||||
|
6
ghost/email-suppression-list/test/index.test.js
Normal file
6
ghost/email-suppression-list/test/index.test.js
Normal file
@ -0,0 +1,6 @@
|
||||
const assert = require('assert');
|
||||
describe('exports', function () {
|
||||
it('exports the lib/email-suppression-list file', function () {
|
||||
assert(require('../') === require('../lib/email-suppression-list'));
|
||||
});
|
||||
});
|
@ -0,0 +1,26 @@
|
||||
const assert = require('assert');
|
||||
const {EmailSuppressionData} = require('../../lib/email-suppression-list');
|
||||
|
||||
describe('EmailSuppressionData', function () {
|
||||
it('Has null info when not suppressed', function () {
|
||||
const now = new Date();
|
||||
const data = new EmailSuppressionData(false, {
|
||||
reason: 'spam',
|
||||
timestamp: now
|
||||
});
|
||||
|
||||
assert(data.suppressed === false);
|
||||
assert(data.info === null);
|
||||
});
|
||||
it('', function () {
|
||||
const now = new Date();
|
||||
const data = new EmailSuppressionData(true, {
|
||||
reason: 'spam',
|
||||
timestamp: now
|
||||
});
|
||||
|
||||
assert(data.suppressed === true);
|
||||
assert(data.info.reason === 'spam');
|
||||
assert(data.info.timestamp === now);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user