Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kytta committed Jul 1, 2024
1 parent 82d24e6 commit 8018dc6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Binary file added test/fixtures/update-bun/bun.lockb
Binary file not shown.
7 changes: 7 additions & 0 deletions test/fixtures/update-bun/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"devDependencies": {
"autoprefixer": "^9.7.4",
"postcss-preset-env": "^6.7.0",
"qs": "^6.6.0"
}
}
14 changes: 14 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,4 +264,18 @@ test('updates caniuse-lite for pnpm', async () => {
)
})

test('updates caniuse-lite for bun', async () => {
await chdir('update-bun', 'package.json', 'bun.lockb')
match(
runUpdate(),
`Latest version: ${caniuse.version}\n` +
'Updating caniuse-lite version\n' +
'$ bun update caniuse-lite\n' +
'caniuse-lite has been successfully updated\n'
)

let pmls = execSync('bun pm ls --all', { env: { ...process.env, NO_COLOR: "1", FORCE_COLOR: "0" } }).toString()
ok(pmls.includes(`caniuse-lite@${caniuse.version}`))
})

test.run()

0 comments on commit 8018dc6

Please sign in to comment.