Skip to content

Commit

Permalink
Fix require (py submodule) test in Node port
Browse files Browse the repository at this point in the history
  • Loading branch information
jfblomgren committed Apr 19, 2021
1 parent d30cbad commit c6fb1b6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions source/ports/node_port/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,17 @@ describe('metacall', () => {
assert.notStrictEqual(escape, undefined);
assert.strictEqual(escape('<html></html>'), '&lt;html&gt;&lt;/html&gt;');
});
// TODO: This fails, not sure why
/*
it('require (py submodule)', () => {
// This code loads directly a module without extension from Python
const { py_encode_basestring_ascii } = require('json.encoder');
assert.notStrictEqual(py_encode_basestring_ascii, undefined);
assert.strictEqual(py_encode_basestring_ascii('asd'), '"asd"');
const { find_library } = require('ctypes.util');
assert.notStrictEqual(find_library, undefined);

// TODO: This fails because the submodule imports a class, which
// is not yet supported by the NodeJS loader
//const { py_encode_basestring_ascii } = require('json.encoder');
//assert.notStrictEqual(py_encode_basestring_ascii, undefined);
//assert.strictEqual(py_encode_basestring_ascii('asd'), '"asd"');
});
*/
it('require (rb)', () => {
// TODO: Both methods work, should we disable the commented out style to be NodeJS compilant?
// const cache = require('cache.rb');
Expand Down

0 comments on commit c6fb1b6

Please sign in to comment.