File tree 1 file changed +9
-3
lines changed
test/integration/create-next-app/package-manager
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change
1
+ import execa from 'execa'
2
+ import * as semver from 'semver'
1
3
import {
2
4
command ,
3
5
DEFAULT_FILES ,
@@ -7,11 +9,9 @@ import {
7
9
useTempDir ,
8
10
} from '../utils'
9
11
10
- const lockFile = 'bun.lockb'
11
- const files = [ ...DEFAULT_FILES , lockFile ]
12
-
13
12
describe ( 'create-next-app with package manager bun' , ( ) => {
14
13
let nextTgzFilename : string
14
+ let files : string [ ]
15
15
16
16
beforeAll ( async ( ) => {
17
17
if ( ! process . env . NEXT_TEST_PKG_PATHS ) {
@@ -27,6 +27,12 @@ describe('create-next-app with package manager bun', () => {
27
27
await command ( 'bun' , [ '--version' ] )
28
28
// install bun if not available
29
29
. catch ( ( ) => command ( 'npm' , [ 'i' , '-g' , 'bun' ] ) )
30
+
31
+ const bunVersion = ( await execa ( 'bun' , [ '--version' ] ) ) . stdout . trim ( )
32
+ // Some CI runners pre-install Bun.
33
+ // Locally, we don't pin Bun either.
34
+ const lockFile = semver . gte ( bunVersion , '1.2.0' ) ? 'bun.lock' : 'bun.lockb'
35
+ files = [ ...DEFAULT_FILES , lockFile ]
30
36
} )
31
37
32
38
it ( 'should use bun for --use-bun flag' , async ( ) => {
You can’t perform that action at this time.
0 commit comments