Skip to content

Commit

Permalink
manually add assetpath (import.meta.url) for tests that require it
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliott Marquez committed Apr 17, 2018
1 parent 09b11fa commit 0c85065
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion test/unit/sub/resolveurl-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import { html } from '../../../lib/utils/html-tag.js';
import { PolymerElement } from '../../../polymer-element.js';
import { DomModule } from '../../../lib/elements/dom-module.js';
import { Polymer } from '../../../lib/legacy/polymer-fn.js';
import { pathFromUrl } from '../utils/resolve-url.js';
const $_documentContainer = document.createElement('div');
$_documentContainer.setAttribute('style', 'display: none;');
$_documentContainer.innerHTML = `<dom-module id="p-r-ap" assetpath="../../assets/"></dom-module>`;
const baseAssetPath = pathFromUrl(import.meta.url);
$_documentContainer.innerHTML = `<dom-module id="p-r-ap" assetpath="${baseAssetPath}../../assets/"></dom-module>`;
document.head.appendChild($_documentContainer);
class PR extends PolymerElement {
static get template() {
Expand Down
8 changes: 5 additions & 3 deletions test/unit/sub/style-import.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { pathFromUrl } from '../utils/resolve-url.js';

const $_documentContainer = document.createElement('div');
$_documentContainer.setAttribute('style', 'display: none;');

$_documentContainer.innerHTML = `<dom-module id="style-import">
const baseAssetPath = pathFromUrl(import.meta.url);
$_documentContainer.innerHTML = `<dom-module id="style-import" assetpath="${baseAssetPath}">
<template>
<style>
.foo {
Expand All @@ -11,7 +13,7 @@ $_documentContainer.innerHTML = `<dom-module id="style-import">
}
</style>
</template>
</dom-module><dom-module id="style-import2">
</dom-module><dom-module id="style-import2" assetpath="${baseAssetPath}">
<template>
<style>
.foo {
Expand Down

0 comments on commit 0c85065

Please sign in to comment.