mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Test that ESM modules can be imported from npm packages.
With appropriate meteor.nodeModules.recompile configuration, that is.
This commit is contained in:
13
tools/tests/apps/modules/package-lock.json
generated
13
tools/tests/apps/modules/package-lock.json
generated
@@ -185,6 +185,14 @@
|
||||
"to-fast-properties": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@polymer/lit-element": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@polymer/lit-element/-/lit-element-0.7.1.tgz",
|
||||
"integrity": "sha512-aYSzVhC19l7xSm73aHI06VPcD/H+GxpFNZrhbJ+zVIpgAveOgGp5Ga7UtTBHQCdHlJbZ0dMlaBXMZ3twgXCokg==",
|
||||
"requires": {
|
||||
"lit-html": "^1.0.0-rc.2"
|
||||
}
|
||||
},
|
||||
"@wry/context": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@wry/context/-/context-0.4.0.tgz",
|
||||
@@ -658,6 +666,11 @@
|
||||
"react": "16.4.1"
|
||||
}
|
||||
},
|
||||
"lit-html": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/lit-html/-/lit-html-1.1.0.tgz",
|
||||
"integrity": "sha512-ZDJHpJi09yknMpjwPI8fuSl5sUG7+pF+eE5WciFtgyX7zebvgMDBgSLq4knXa7grxM00RkQ7PBd7UZQiruA78Q=="
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.11",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"@babel/plugin-proposal-do-expressions": "^7.2.0",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.2.0",
|
||||
"@babel/runtime": "^7.4.5",
|
||||
"@polymer/lit-element": "0.7.1",
|
||||
"@wry/context": "^0.4.0",
|
||||
"acorn": "file:imports/links/acorn",
|
||||
"aws-sdk": "^2.2.41",
|
||||
@@ -36,6 +37,12 @@
|
||||
"test-packages": "TEST_BROWSER_DRIVER=puppeteer meteor test-packages --driver-package meteortesting:mocha packages/modules-test-package"
|
||||
},
|
||||
"meteor": {
|
||||
"testModule": "tests.js"
|
||||
"testModule": "tests.js",
|
||||
"nodeModules": {
|
||||
"recompile": {
|
||||
"pify": "legacy",
|
||||
"@polymer/lit-element": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,6 +371,47 @@ describe("local node_modules", () => {
|
||||
assert.strictEqual(typeof parse, "function");
|
||||
assert.strictEqual(parse, nestedParse);
|
||||
});
|
||||
|
||||
Meteor.isClient && it("can import @polymer/lit-element", () => {
|
||||
// This import is enabled by the meteor.nodeModules.recompile section of
|
||||
// the package.json file for the modules test application.
|
||||
const litElement = require("@polymer/lit-element");
|
||||
const typeofMap = {};
|
||||
Object.keys(litElement).forEach(key => {
|
||||
typeofMap[key] = typeof litElement[key];
|
||||
});
|
||||
|
||||
assert.deepEqual(typeofMap, {
|
||||
defaultConverter: "object",
|
||||
notEqual: "function",
|
||||
UpdatingElement: "function",
|
||||
customElement: "function",
|
||||
property: "function",
|
||||
query: "function",
|
||||
queryAll: "function",
|
||||
eventOptions: "function",
|
||||
html: "function",
|
||||
svg: "function",
|
||||
TemplateResult: "function",
|
||||
SVGTemplateResult: "function",
|
||||
supportsAdoptingStyleSheets: "boolean",
|
||||
CSSResult: "function",
|
||||
css: "function",
|
||||
LitElement: "function"
|
||||
});
|
||||
});
|
||||
|
||||
it("can import @babel/runtime/helpers/esm/*", () => {
|
||||
function check(exports) {
|
||||
assert.strictEqual(typeof exports.default, "function");
|
||||
}
|
||||
check(require("@babel/runtime/helpers/esm/asyncIterator.js"));
|
||||
check(require("@babel/runtime/helpers/esm/createClass.js"));
|
||||
check(require("@babel/runtime/helpers/esm/getPrototypeOf.js"));
|
||||
check(require("@babel/runtime/helpers/esm/inherits.js"));
|
||||
check(require("@babel/runtime/helpers/esm/toArray.js"));
|
||||
check(require("@babel/runtime/helpers/esm/typeof.js"));
|
||||
});
|
||||
});
|
||||
|
||||
describe("Meteor packages", () => {
|
||||
|
||||
Reference in New Issue
Block a user