(fix) !spells and !chants returned null value (#40)

This commit is contained in:
2021-05-04 22:39:59 +02:00
committed by GitHub
parent 895f47847e
commit 4fa2dc7ab7
7 changed files with 56 additions and 7 deletions

View File

@ -1,5 +1,6 @@
require('module-alias/register');
const rewire = require('rewire');
const Attack = require('@Commands/Attack');
const rewireUtils = rewire('@Commands/Attack');
const getWeapon = rewireUtils.__get__('getWeapon');
@ -13,6 +14,12 @@ const getCombatTechnique = rewireUtils.__get__('getCombatTechnique');
it('should be undefined without value', () => {
expect(getCombatTechnique({})).toBeUndefined();
});
it('should be undefined without value', () => {
expect(getCombatTechnique({ combattechnique: 'made-up' })).toBeUndefined();
});
it('should be null without any params.', () => {
expect(getCombatTechnique()).toBeNull();
});
it('should return defined object', () => {
expect(getCombatTechnique({ combattechnique: 'dolche' })).toEqual(
expect.objectContaining({