Skip to content

Commit

Permalink
test: pack-gzip-level
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Apr 16, 2023
1 parent 21715fb commit dde3cc8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions releasing/plugin-commands-publishing/src/pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export function rcOptionsTypes () {
export function cliOptionsTypes () {
return {
'pack-destination': String,
...pick([
'pack-gzip-level',
], allTypes),
}
}

Expand Down
18 changes: 18 additions & 0 deletions releasing/plugin-commands-publishing/test/pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,21 @@ test('pack to custom destination directory', async () => {

expect(output).toBe(path.resolve('custom-dest/custom-dest-0.0.0.tgz'))
})

test('pack: custom pack-gzip-level', async () => {
prepare({
name: 'test-publish-package.json',
version: '0.0.0',
})

await pack.handler({
...DEFAULT_OPTS,
argv: { original: [] },
dir: process.cwd(),
extraBinPaths: [],
packGzipLevel: 9,
})

expect(await exists('test-publish-package.json-0.0.0.tgz')).toBeTruthy()
expect(await exists('package.json')).toBeTruthy()
})

0 comments on commit dde3cc8

Please sign in to comment.