forked from tryggingamidstodin/node-jt400
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-cjs.cjs
More file actions
32 lines (26 loc) · 779 Bytes
/
Copy pathtest-cjs.cjs
File metadata and controls
32 lines (26 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env node
/**
* This script tests the CommonJS build
*/
const { pool } = require('./dist-cjs/index.js')
console.log('Testing CommonJS build...')
console.log('Current working directory:', process.cwd())
try {
const connection = pool({
host: 'test-host',
user: 'test-user',
password: 'test-password',
})
console.log('✓ Successfully initialized Java bridge in CommonJS')
console.log('✓ Found JAR files from package root')
console.log('✓ CommonJS build works correctly')
console.log('Connection object created:', typeof connection)
process.exit(0)
} catch (error) {
console.error('✗ Failed to initialize CommonJS build:')
console.error(error.message)
if (error.stack) {
console.error(error.stack)
}
process.exit(1)
}