-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: detect bun as runtime * chore: export bun as runtime * chore: fix test message
- Loading branch information
1 parent
21cafcf
commit 6f87850
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { beforeEach, expect, test } from 'vitest' | ||
|
||
import { mockFileSystem } from '../../tests/mock-file-system.js' | ||
import { NodeFS } from '../node/file-system.js' | ||
import { Project } from '../project.js' | ||
|
||
beforeEach((ctx) => { | ||
ctx.fs = new NodeFS() | ||
}) | ||
|
||
test('detects node when bunfig.toml is present', async ({ fs }) => { | ||
const cwd = mockFileSystem({ | ||
'bunfig.toml': '', | ||
}) | ||
|
||
const detected = await new Project(fs, cwd).detectRuntime() | ||
expect(detected[0].name).toBe('Bun') | ||
}) | ||
|
||
test('detects node when bun.lockb is present', async ({ fs }) => { | ||
const cwd = mockFileSystem({ | ||
'bun.lockb': '', | ||
}) | ||
|
||
const detected = await new Project(fs, cwd).detectRuntime() | ||
expect(detected[0].name).toBe('Bun') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { LangRuntime } from './runtime.js' | ||
|
||
export class Bun extends LangRuntime { | ||
id = 'bun' | ||
name = 'Bun' | ||
configFiles = ['bun.lockb', 'bunfig.toml'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters