(dev) remove rewire, add babel-plugin-rewire. (#44)

* removed rewire. now using babel-rewire instead

* implemented more tests

* changed some eslint params

* linting

* linting

* coverage on getChant

Co-authored-by: Marcus Netz <marcus.netz@godyo.com>
This commit is contained in:
2021-05-06 12:52:33 +02:00
committed by GitHub
parent 4fa2dc7ab7
commit 79c95cea97
14 changed files with 807 additions and 311 deletions

View File

@ -1,3 +1,4 @@
require('module-alias/register');
const Discord = require('discord.js');
const { findMessage } = require('@dsabot/findMessage');
const { getChant } = require('@dsabot/getChant');
@ -11,19 +12,18 @@ const createChantList = (Character = {}) => {
Character.chants.forEach(chant =>
ChantList.push(getChant({ Character: Character, chant_name: chant.id }))
);
console.log(ChantList);
return ChantList.filter(value => value !== undefined && value !== null);
};
const ReplyChantList = (ChantList = []) => {
if (!ChantList) return null;
if (!ChantList || ChantList.length === 0) return null;
return `${ChantList.map(chant => `${chant.Name} ${chant.Level ? `(${chant.Level})` : ''}`).join(
'\n'
)}`;
};
const ReplyChant = (Chant = {}) => {
if (!Chant) return null;
if (!Chant || Object.keys(Chant).length === 0) return null;
return `Deine Werte für ${Chant.Name} ${Chant.Level ? `(${Chant.Level})` : ''} sind:
${Chant.Attributes.map(attribute => `${attribute.Name}: ${attribute.Level}`).join(' ')}