-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Description
import {AmpAnalytics} from '../amp-analytics';
The above line in tests would have a side effect causing amp-analytics custom element registered on global window. We should consider split all extension js to
in amp-analytics/0.1/amp-analytics.js
export class AmpAnalytics {
...
}
in amp-analytics/0.1/main.js
AMP.extension(TAG, '0.1', AMP => {
// Register doc-service factory.
AMP.registerServiceForDoc(
'amp-analytics-instrumentation',
InstrumentationService
);
AMP.registerServiceForDoc('activity', Activity);
installLinkerReaderService(AMP.win);
AMP.registerServiceForDoc('amp-analytics-variables', VariableService);
// Register the element.
AMP.registerElement(TAG, AmpAnalytics);
});
No unit test should ever import main.js, amp.js etc.
Reactions are currently unavailable