@pipcook/boa-cloud
Version:
Use Python modules seamlessly in Node.js
16 lines (13 loc) • 323 B
text/typescript
import * as boa from '../../';
import test from 'ava';
test.cb('test typescript with-statement', (t) => {
t.plan(1);
const { open } = boa.builtins();
boa.with(open(__filename, 'r'), (f) => {
console.log(f);
t.pass();
// no need to close because of `boa.with()`.
}).then(() => {
t.end();
});
});