MCPcopy Create free account
hub / github.com/tensorflow/tensorboard / setup

Function setup

tensorboard/webapp/plugins/plugins_container_test.ts:160–203  ·  view source on GitHub ↗

* Configures default behavior of the MockStore. * Call this only after all providers have been configured as it will freeze * the TestBed configuration.

(providersOverride?: any[])

Source from the content-addressed store, hash-verified

158 * the TestBed configuration.
159 */
160 async function setup(providersOverride?: any[]) {
161 await TestBed.configureTestingModule({
162 providers: [
163 provideMockTbStore(),
164 PluginsContainer,
165 PluginRegistryModule,
166 getTestingProvider(),
167 ...(providersOverride ? providersOverride : []),
168 ],
169 declarations: [
170 PluginsContainer,
171 PluginsComponent,
172 CustomizedErrorTemplatesComponent,
173 ],
174 imports: [TestingDebuggerModule, ExtraDashboardModule],
175 });
176
177 store = TestBed.inject<Store<State>>(Store) as MockStore<State>;
178 store.overrideSelector(getPlugins, PLUGINS);
179 store.overrideSelector(getActivePlugin, null);
180 store.overrideSelector(getPluginsListLoaded, {
181 state: DataLoadState.NOT_LOADED,
182 lastLoadedTimeInMs: null,
183 failureCode: null,
184 });
185 store.overrideSelector(getEnvironment, {
186 data_location: 'foobar',
187 window_title: 'Tests!',
188 });
189 store.overrideSelector(getIsFeatureFlagsLoaded, true);
190 store.overrideSelector(getFeatureFlags, buildFeatureFlag());
191 store.overrideSelector(getAppLastLoadedTimeInMs, null);
192 store.overrideSelector(
193 settingsSelectors.getSettingsLoadState,
194 DataLoadState.LOADED
195 );
196
197 createElementSpy = spyOn(document, 'createElement').and.callThrough();
198 createElementSpy
199 .withArgs('tf-experimental-plugin-host-lib')
200 .and.returnValue({
201 registerPluginIframe: () => {},
202 });
203 }
204
205 describe('plugin DOM creation', () => {
206 beforeEach(async () => {

Callers 2

setup.pyFile · 0.85

Calls 3

provideMockTbStoreFunction · 0.90
getTestingProviderFunction · 0.90
buildFeatureFlagFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…