Skip to content

Commit 1d8a3cb

Browse files
committed
Add comment
1 parent e95c12e commit 1d8a3cb

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

bunfig.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ coverage = true
55
coverageReporter = ["text", "lcov"]
66
coverageThreshold = { line = 1.0, function = 1.0, statement = 1.0 }
77
coverageSkipTestFiles = true
8+
# pkg/dist are generated artifacts. bun-plugin/src/plugin.ts registers a Bun
9+
# plugin at import time; testing its private hooks would require exporting
10+
# internals that are not part of the public API.
811
coveragePathIgnorePatterns = ["**/pkg/**", "**/dist/**", "**/bun-plugin/src/plugin.ts"]

packages/bun-plugin/src/__tests__/plugin.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,10 @@ describe('getDevupDefine', () => {
8686

8787
describe('writeDataFiles behavior', () => {
8888
it('should register theme from devup.json when it exists', async () => {
89-
existsSyncSpy.mockImplementation((path: string) => path === 'devup.json')
9089
readFileSpy.mockResolvedValue('{"theme": {"colors": {"primary": "#000"}}}')
9190
getThemeInterfaceSpy.mockReturnValue('interface CustomColors {}')
9291

93-
// Simulate writeDataFiles behavior
92+
// Simulate writeDataFiles behavior without exporting private plugin helpers.
9493
const content = '{"theme": {"colors": {"primary": "#000"}}}'
9594
const parsed = JSON.parse(content)
9695
registerThemeSpy(parsed?.['theme'] ?? {})
@@ -101,7 +100,6 @@ describe('writeDataFiles behavior', () => {
101100
})
102101

103102
it('should write theme.d.ts when interfaceCode is returned', async () => {
104-
existsSyncSpy.mockImplementation((path: string) => path === 'devup.json')
105103
getThemeInterfaceSpy.mockReturnValue('interface CustomColors {}')
106104

107105
const interfaceCode = getThemeInterfaceSpy(
@@ -127,7 +125,7 @@ describe('writeDataFiles behavior', () => {
127125
it('should register empty theme when devup.json does not exist', async () => {
128126
existsSyncSpy.mockReturnValue(false)
129127

130-
// Simulate the else branch
128+
// Simulate the missing config branch.
131129
const content = undefined
132130
if (!content) {
133131
registerThemeSpy({})
@@ -164,7 +162,7 @@ describe('writeDataFiles behavior', () => {
164162
it('should create css directory when it does not exist', async () => {
165163
existsSyncSpy.mockReturnValue(false)
166164

167-
// Simulate the Promise.all behavior
165+
// Simulate the directory creation branch without exposing internals.
168166
if (!existsSyncSpy('df/devup-ui')) {
169167
await mkdirSpy('df/devup-ui', { recursive: true })
170168
}

0 commit comments

Comments
 (0)