feat: Convert factories files to JS
This commit is contained in:
8
packages/backend/test/factories/role.js
Normal file
8
packages/backend/test/factories/role.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export const createRole = async (params = {}) => {
|
||||
params.name = params?.name || 'Viewer';
|
||||
params.key = params?.key || 'viewer';
|
||||
|
||||
const [role] = await global.knex.table('roles').insert(params).returning('*');
|
||||
|
||||
return role;
|
||||
};
|
Reference in New Issue
Block a user