Skip to content

Commit

Permalink
Add tests for coverage support
Browse files Browse the repository at this point in the history
  • Loading branch information
cezaraugusto committed Sep 3, 2024
1 parent bea25c7 commit 84bca86
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions programs/develop/webpack/lib/__spec__/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,26 @@ describe('utils', () => {
})
})
})

describe('isFromPnpx', () => {
it('should return "pnpm" if the command is from pnpm', () => {
process.env.npm_config_user_agent = 'pnpm'
const result = utils.isFromPnpx()
expect(result).toBe('pnpm')
})

it('should return false if the command is not from pnpm', () => {
process.env.npm_config_user_agent = 'npm'
const result = utils.isFromPnpx()
expect(result).toBe(false)
})

it('should return false if npm_config_user_agent is not set', () => {
delete process.env.npm_config_user_agent
const result = utils.isFromPnpx()
expect(result).toBe(false)
})
})
})


0 comments on commit 84bca86

Please sign in to comment.