diff --git a/packages/bundler/src/test/bundle-manifest_test.ts b/packages/bundler/src/test/bundle-manifest_test.ts index f7d64785a..f65fd4d4a 100644 --- a/packages/bundler/src/test/bundle-manifest_test.ts +++ b/packages/bundler/src/test/bundle-manifest_test.ts @@ -15,9 +15,9 @@ /// import * as chai from 'chai'; import {ResolvedUrl} from 'polymer-analyzer'; -import {resolvedUrl as r} from 'polymer-analyzer/lib/test/test-utils'; import {Bundle, BundleManifest, composeStrategies, generateBundles, generateCountingSharedBundleUrlMapper, generateEagerMergeStrategy, generateMatchMergeStrategy, generateSharedBundleUrlMapper, generateSharedDepsMergeStrategy, generateShellMergeStrategy, mergeBundles, mergeSingleEntrypointSubBundles, TransitiveDependenciesMap} from '../bundle-manifest'; +import {resolvedUrl as r} from '../test/test-utils'; chai.config.showDiff = true; diff --git a/packages/bundler/src/test/test-utils.ts b/packages/bundler/src/test/test-utils.ts index ce35a6465..cac8fdf21 100644 --- a/packages/bundler/src/test/test-utils.ts +++ b/packages/bundler/src/test/test-utils.ts @@ -11,7 +11,7 @@ * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -import {Analyzer, InMemoryOverlayUrlLoader, PackageRelativeUrl, PackageUrlResolver} from 'polymer-analyzer'; +import {Analyzer, InMemoryOverlayUrlLoader, PackageRelativeUrl, PackageUrlResolver, ResolvedUrl} from 'polymer-analyzer'; /** * Automatically left-justifies an indented multi-line template literal string @@ -88,6 +88,17 @@ export function mindent(text: string): number { return mindent === null ? 0 : mindent; } +export const noOpTag = + (strings: TemplateStringsArray, ...values: string[]): string => + values.reduce( + (r: string, v: string, i) => r + String(v) + strings[i + 1], + strings[0]); + +export function resolvedUrl( + strings: TemplateStringsArray, ...values: string[]): ResolvedUrl { + return noOpTag(strings, ...values) as ResolvedUrl; +} + /** * Left-justifies text in a multi-line indented string, but preserves relative * indentation; `undent(' a\n b')` returns `'a\n b'`.