refactor: replace zod with shapeshift (#7547)

This commit is contained in:
Parbez
2022-04-09 15:07:16 +05:30
committed by GitHub
parent 3f3e4327c8
commit 3c0bbac82f
14 changed files with 105 additions and 116 deletions

View File

@@ -101,10 +101,10 @@ describe('Embed', () => {
expect(embed.toJSON()).toStrictEqual({ url: undefined });
});
test('GIVEN an embed with an invalid URL THEN throws error', () => {
test.each(['owo', 'discord://user'])('GIVEN an embed with an invalid URL THEN throws error', (input) => {
const embed = new EmbedBuilder();
expect(() => embed.setURL('owo')).toThrowError();
expect(() => embed.setURL(input)).toThrowError();
});
});
@@ -325,7 +325,7 @@ describe('Embed', () => {
embed.addFields({ name: 'foo', value: 'bar' });
expect(embed.toJSON()).toStrictEqual({
fields: [{ name: 'foo', value: 'bar' }],
fields: [{ name: 'foo', value: 'bar', inline: undefined }],
});
});
@@ -334,7 +334,7 @@ describe('Embed', () => {
embed.addFields({ name: 'foo', value: 'bar' }, { name: 'foo', value: 'baz' });
expect(embed.spliceFields(0, 1).toJSON()).toStrictEqual({
fields: [{ name: 'foo', value: 'baz' }],
fields: [{ name: 'foo', value: 'baz', inline: undefined }],
});
});