Skip to content

Commit

Permalink
test: use correct masktoken fn
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Oct 2, 2024
1 parent fe4733d commit 1cbd2be
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/commands/login/actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ vi.mock('ofetch', () => ({
ofetch: vi.fn(),
}))

vi.mock('../../utils', () => ({
maskToken: (token: string) => token.replace(/.(?=.{4})/g, '*'),
}))

describe('login actions', () => {
beforeEach(() => {
vi.clearAllMocks()
Expand All @@ -33,7 +29,7 @@ describe('login actions', () => {
ofetch.mockRejectedValue(mockError)

await expect(loginWithToken('invalid-token', 'eu')).rejects.toThrow(
new Error(`The token provided ${chalk.bold('*********oken')} is invalid: ${chalk.bold('401 Unauthorized')}
new Error(`The token provided ${chalk.bold('inva*********')} is invalid: ${chalk.bold('401 Unauthorized')}
Please make sure you are using the correct token and try again.`),
)
Expand Down

0 comments on commit 1cbd2be

Please sign in to comment.