Skip to content

Commit c6fb1b6

Browse files
committed
Fix require (py submodule) test in Node port
1 parent d30cbad commit c6fb1b6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

source/ports/node_port/test/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,17 @@ describe('metacall', () => {
140140
assert.notStrictEqual(escape, undefined);
141141
assert.strictEqual(escape('<html></html>'), '&lt;html&gt;&lt;/html&gt;');
142142
});
143-
// TODO: This fails, not sure why
144-
/*
145143
it('require (py submodule)', () => {
146144
// This code loads directly a module without extension from Python
147-
const { py_encode_basestring_ascii } = require('json.encoder');
148-
assert.notStrictEqual(py_encode_basestring_ascii, undefined);
149-
assert.strictEqual(py_encode_basestring_ascii('asd'), '"asd"');
145+
const { find_library } = require('ctypes.util');
146+
assert.notStrictEqual(find_library, undefined);
147+
148+
// TODO: This fails because the submodule imports a class, which
149+
// is not yet supported by the NodeJS loader
150+
//const { py_encode_basestring_ascii } = require('json.encoder');
151+
//assert.notStrictEqual(py_encode_basestring_ascii, undefined);
152+
//assert.strictEqual(py_encode_basestring_ascii('asd'), '"asd"');
150153
});
151-
*/
152154
it('require (rb)', () => {
153155
// TODO: Both methods work, should we disable the commented out style to be NodeJS compilant?
154156
// const cache = require('cache.rb');

0 commit comments

Comments
 (0)