Skip to content

Commit b65e1b2

Browse files
committed
test: handle both string and object bin formats in package test
1 parent 5ad2bff commit b65e1b2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/package.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@ describe('Package configuration', () => {
1212

1313
it('should have correct bin configuration', () => {
1414
expect(packageJson.bin).toBeDefined();
15-
expect(typeof packageJson.bin).toBe('object');
16-
expect(packageJson.bin).toHaveProperty('mcp-wayback-machine');
17-
expect(packageJson.bin['mcp-wayback-machine']).toBe('dist/index.js');
15+
// Handle both string and object forms of bin
16+
if (typeof packageJson.bin === 'string') {
17+
// If bin is a string, it should be the path directly
18+
expect(packageJson.bin).toBe('dist/index.js');
19+
} else {
20+
// If bin is an object, check the property
21+
expect(typeof packageJson.bin).toBe('object');
22+
expect(packageJson.bin).toHaveProperty('mcp-wayback-machine');
23+
expect(packageJson.bin['mcp-wayback-machine']).toBe('dist/index.js');
24+
}
1825
});
1926

2027
it('should have correct main entry point', () => {

0 commit comments

Comments
 (0)