Ghost/test/unit/server/web/shared/middleware/api/spam-prevention.test.js
Hannah Wolfe 9e96b04542
Moved server unit tests into the server folder
- this is a small part of a bit of cleanup of our test files
- the goal is to make the existing tests clearer with a view to making it easier to write more tests
- this makes the test structure follow the codebase structure more closely
- eventually we will colocate the tests as we break the codebase down further
2021-10-06 12:01:09 +01:00

18 lines
646 B
JavaScript

const should = require('should');
const spamPrevention = require('../../../../../../../core/server/web/shared/middlewares/api/spam-prevention');
describe('Spam Prevention', function () {
it('exports a contentApiKey method', function () {
should.equal(typeof spamPrevention.contentApiKey, 'function');
});
describe('contentApiKey method', function () {
it('returns an instance of express-brute', function () {
const ExpressBrute = require('express-brute');
const result = spamPrevention.contentApiKey();
should.equal(result instanceof ExpressBrute, true);
});
});
});