fix(test-moddir): exercise function exports
Fix the exports by upgrading transform-module.
Closes
MODIFY
package-lock.json
package-lock.json
}
},
"@agoric/transform-module": {
- "version": "0.1.6",
- "resolved": "https://registry.npmjs.org/@agoric/transform-module/-/transform-module-0.1.6.tgz",
- "integrity": "sha512-sGtqhei7vGF220vaGkiGtHzu4LaiSZXiObb418VzChRhr3dnzf0qSYN48X0FG1shso6dAp4Lt1CL4ekvn7PiJQ==",
+ "version": "0.1.7",
+ "resolved": "https://registry.npmjs.org/@agoric/transform-module/-/transform-module-0.1.7.tgz",
+ "integrity": "sha512-pqTB+kAA7dpiS0nNn5oYFTw7jdg0FM/rEYSuO4wCNaGnxcChZ+ktoQo42BYDT5VWvO1TN1Ah/6G0/RxJWU2tfg==",
"dev": true,
"requires": {
"@agoric/evaluate": "^2.1.3",

MODIFY
package.json
package.json
"lint-check-jessie": "eslint -c '.eslintrc-jessie.js' '**/*.{js,jsx}'"
},
"devDependencies": {
- "@agoric/transform-module": "^0.1.6",
+ "@agoric/transform-module": "^0.1.7",
"@babel/core": "^7.6.0",
"eslint": "^6.1.0",
"eslint-config-airbnb-base": "^14.0.0",

ADD
test/moddir/function.js
+export function fn1() {
+ return 'fn1';
+};
+function fn2() {
+ return 'fn2';
+}
+export { fn2 };

MODIFY
test/test-moddir.js
test/test-moddir.js
@@ -51,6 +51,12 @@ with (arguments[1]) {
},
`importer works`,
);
+
+ const ns = await importer({ spec: './function', url: `${rootUrl}/` }, endowments);
+ t.is(typeof ns.fn1, 'function', `function fn1 is exported`);
+ t.is(ns.fn1(), 'fn1', 'function fn1 is executable');
+ t.is(typeof ns.fn2, 'function', `function fn2 is exported`);
+ t.is(ns.fn2(), 'fn2', 'function fn2 is executable');
} catch (e) {
t.isNot(e, e, 'unexpected exception');
} finally {

fix(test-moddir): exercise function exports

Fix the exports by upgrading transform-module.

Closes #6.