Skip to content

Commit d13e631

Browse files
committed
fix tests
1 parent 6876e2a commit d13e631

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

packages/artifact/__tests__/util.test.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,34 +69,28 @@ describe('maskSigUrl', () => {
6969
jest.clearAllMocks()
7070
})
7171

72-
it('returns the original URL if no sig parameter is present', () => {
72+
it('does nothing if no sig parameter is present', () => {
7373
const url = 'https://example.com'
74-
const maskedUrl = maskSigUrl(url)
75-
expect(maskedUrl).toBe(url)
74+
maskSigUrl(url)
7675
expect(setSecret).not.toHaveBeenCalled()
7776
})
7877

7978
it('masks the sig parameter in the middle of the URL and sets it as a secret', () => {
8079
const url = 'https://example.com/?param1=value1&sig=12345&param2=value2'
81-
const maskedUrl = maskSigUrl(url)
82-
expect(maskedUrl).toBe(
83-
'https://example.com/?param1=value1&sig=***&param2=value2'
84-
)
80+
maskSigUrl(url)
8581
expect(setSecret).toHaveBeenCalledWith('12345')
8682
expect(setSecret).toHaveBeenCalledWith(encodeURIComponent('12345'))
8783
})
8884

89-
it('returns the original URL if it is empty', () => {
85+
it('does nothing if the URL is empty', () => {
9086
const url = ''
91-
const maskedUrl = maskSigUrl(url)
92-
expect(maskedUrl).toBe('')
87+
maskSigUrl(url)
9388
expect(setSecret).not.toHaveBeenCalled()
9489
})
9590

9691
it('handles URLs with fragments', () => {
9792
const url = 'https://example.com?sig=12345#fragment'
98-
const maskedUrl = maskSigUrl(url)
99-
expect(maskedUrl).toBe('https://example.com/?sig=***#fragment')
93+
maskSigUrl(url)
10094
expect(setSecret).toHaveBeenCalledWith('12345')
10195
expect(setSecret).toHaveBeenCalledWith(encodeURIComponent('12345'))
10296
})

0 commit comments

Comments
 (0)