mirror of
https://github.com/strapi/strapi.git
synced 2025-08-07 08:16:35 +00:00
Fix missing strapi global in entity service tests
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
8589848ce4
commit
e44a3f212e
@ -5,6 +5,15 @@ const entityValidator = require('../entity-validator');
|
||||
const { EventEmitter } = require('events');
|
||||
|
||||
describe('Entity service', () => {
|
||||
global.strapi = {
|
||||
getModel: jest.fn(() => {}),
|
||||
config: {
|
||||
get() {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
describe('Find', () => {
|
||||
test('Returns first element for single types', async () => {
|
||||
const data = {
|
||||
|
@ -78,6 +78,7 @@ module.exports = ({ db, eventHub, entityValidator }) => ({
|
||||
await this.uploadFiles(entry, files, { model });
|
||||
entry = await this.findOne({ params: { id: entry.id } }, { model });
|
||||
}
|
||||
|
||||
eventHub.emit(ENTRY_CREATE, {
|
||||
model: modelDef.modelName,
|
||||
entry: sanitizeEntity(entry, { model: modelDef }),
|
||||
|
Loading…
x
Reference in New Issue
Block a user