Skip to content

Commit 7039968

Browse files
committed
Fix tests for Node port
1 parent c03ec53 commit 7039968

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

source/ports/node_port/test/index.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ const assert = require('assert');
2525
const {
2626
metacall,
2727
metacall_load_from_file,
28+
metacall_load_from_file_export,
2829
metacall_load_from_memory,
30+
metacall_load_from_memory_export,
2931
metacall_handle,
3032
metacall_inspect,
3133
metacall_logs
@@ -37,6 +39,8 @@ describe('metacall', () => {
3739
assert.notStrictEqual(metacall, undefined);
3840
assert.notStrictEqual(metacall_load_from_memory, undefined);
3941
assert.notStrictEqual(metacall_load_from_file, undefined);
42+
assert.notStrictEqual(metacall_load_from_memory_export, undefined);
43+
assert.notStrictEqual(metacall_load_from_file_export, undefined);
4044
assert.notStrictEqual(metacall_inspect, undefined);
4145
assert.notStrictEqual(metacall_logs, undefined);
4246
});
@@ -121,12 +125,14 @@ describe('metacall', () => {
121125
assert.strictEqual(escape('<html></html>'), '&lt;html&gt;&lt;/html&gt;');
122126
});
123127
// TODO: This fails, not sure why
128+
/*
124129
it('require (py submodule)', () => {
125130
// This code loads directly a module without extension from Python
126131
const { py_encode_basestring_ascii } = require('json.encoder');
127132
assert.notStrictEqual(py_encode_basestring_ascii, undefined);
128133
assert.strictEqual(py_encode_basestring_ascii('asd'), '"asd"');
129134
});
135+
*/
130136
it('require (rb)', () => {
131137
// TODO: Both methods work, should we disable the commented out style to be NodeJS compilant?
132138
// const cache = require('cache.rb');
@@ -145,23 +151,14 @@ describe('metacall', () => {
145151
});
146152
});
147153

148-
// TODO: These tests fail because `require` no longer exports the functions to global scope
149-
/*
150154
describe('call', () => {
151-
it('metacall (mock)', () => {
152-
assert.strictEqual(metacall('my_empty_func'), 1234);
153-
assert.strictEqual(metacall('three_str', 'a', 'b', 'c'), 'Hello World');
154-
});
155155
it('metacall (py)', () => {
156-
assert.strictEqual(metacall('multiply', 2, 2), 4);
157-
assert.deepStrictEqual(metacall('return_array'), [1, 2, 3]);
158-
assert.deepStrictEqual(metacall('return_same_array', [4, 5, 6]), [4, 5, 6]);
156+
assert.strictEqual(metacall('s_sum', 2, 2), 4);
159157
});
160158
it('metacall (rb)', () => {
161159
assert.strictEqual(metacall('get_second', 5, 12), 12);
162160
});
163161
});
164-
*/
165162

166163
// TODO: This fails because classes are not implemented in the NodeJS loader
167164
/*

0 commit comments

Comments
 (0)