Skip to content

Commit

Permalink
fix(Faces): Escape backslash in Shrug (#10156)
Browse files Browse the repository at this point in the history
* fix(Faces): Escape backslash in `Shrug`

* Update formatters.ts

* Update formatters.ts

* Update formatters.test.ts
  • Loading branch information
cobaltt7 committed Feb 27, 2024
1 parent efa3cac commit 0f9017e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 2 additions & 5 deletions packages/formatters/__tests__/formatters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,9 @@ describe('Message formatters', () => {
});

describe('Faces', () => {
// prettier-ignore
/* eslint-disable no-useless-escape */
test('GIVEN Faces.Shrug THEN returns "¯\_(ツ)_/¯"', () => {
expect<'¯\_(ツ)_/¯'>(Faces.Shrug).toEqual('¯\_(ツ)_/¯');
test('GIVEN Faces.Shrug THEN returns "¯\\_(ツ)_/¯"', () => {
expect<'¯\\_(ツ)_/¯'>(Faces.Shrug).toEqual('¯\\_(ツ)_/¯');
});
/* eslint-enable no-useless-escape */

test('GIVEN Faces.Tableflip THEN returns "(╯°□°)╯︵ ┻━┻"', () => {
expect<'(╯°□°)╯︵ ┻━┻'>(Faces.Tableflip).toEqual('(╯°□°)╯︵ ┻━┻');
Expand Down
4 changes: 1 addition & 3 deletions packages/formatters/src/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,16 +675,14 @@ export const TimestampStyles = {
*/
export type TimestampStylesString = (typeof TimestampStyles)[keyof typeof TimestampStyles];

// prettier-ignore
/**
* All the available faces from Discord's native slash commands.
*/
export enum Faces {
/**
* `¯\_(ツ)_/¯`
*/
// eslint-disable-next-line no-useless-escape
Shrug = '¯\_(ツ)_/¯',
Shrug = '¯\\_(ツ)_/¯',

/**
* `(╯°□°)╯︵ ┻━┻`
Expand Down

0 comments on commit 0f9017e

Please sign in to comment.