How to use the aurelia-testing.StageComponent.withResources function in aurelia-testing

To help you get started, we’ve selected a few aurelia-testing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aurelia / templating-router / test / route-href.spec.ts View on Github external
it('should use route as primary property', done => {
    component = StageComponent
      .withResources(PLATFORM.moduleName('src/route-href'))
      .inView('<a></a>')
      .boundTo({ name: 'b' });

    configure(component);

    component.create(bootstrap)
      .then(() =&gt; {
        expect(component.viewModel.route).toBe('b');
        done();
      });
  });
});
github aurelia / templating-resources / test / compose.integration.spec.ts View on Github external
const bootstrapCompose = async (view?: string, viewModel?: T) =&gt; {
    const component: ComponentTester = StageComponent
      .withResources()
      .inView(view || '')
      .boundTo(viewModel || {});

    await component.create(bootstrap);

    return {
      component,
      compose: component.viewModel,
      viewModel
    };
  };
});
github aurelia / ui-virtualization / test / vr-integration.instance-mutated.spec.ts View on Github external
async function bootstrapComponent($viewModel?: ITestAppInterface) {
      component = StageComponent
        .withResources([
          ...resources,
          ...extraResources
        ])
        .inView($view)
        .boundTo($viewModel);
      await component.create(bootstrap);
      expect(document.body.contains(component.element)).toBe(true, 'repeat is setup in document');
      return { virtualRepeat: component.viewModel, viewModel: $viewModel, component: component };
    }
  }
github aurelia / ui-virtualization / test / vr-integration.infinite-scroll.spec.ts View on Github external
async function bootstrapComponent($viewModel?: ITestAppInterface, extraResources?: any[], $view = view) {
    component = StageComponent
      .withResources([
        ...resources,
        ...extraResources
      ])
      .inView($view)
      .boundTo($viewModel);
    await component.create(bootstrap);
    expect(document.body.contains(component.element)).toBe(true, 'repeat is setup in document');
    return { virtualRepeat: component.viewModel, viewModel: $viewModel, component: component };
  }
github Vheissu / aurelia-google-maps / test / unit / google-maps.ts View on Github external
beforeEach(() =&gt; {
        component = StageComponent
            .withResources('dist/test/src/google-maps')
            .inView('');
    });
github adarshpastakia / aurelia-ui-framework / test / unit / aurelia-ui-framework.spec.ts View on Github external
beforeAll(async () =&gt; {
    component = StageComponent.withResources()
      .inView(``)
      .boundTo({});

    component.bootstrap(aurelia =&gt; {
      return auconfig(aurelia, (config: UIFrameworkConfig) =&gt; {
        config
          .setApiBaseUrl(AppBaseUrl)
          .setApiHeaders(AppHeaders)
          .setKeyValue("title", "Test Title");
      });
    });

    await component.create(bootstrap);
  });
github ged / aurelia-semantic-ui / test / unit / modules / ui-sticky_spec.js View on Github external
beforeEach(() => {
		component = StageComponent.
			withResources('src/modules/ui-sticky');
	});
github ged / aurelia-semantic-ui / test / unit / collections / ui-form_spec.js View on Github external
beforeEach(() => {
		component = StageComponent.
			withResources('src/collections/ui-form');
	});
github ged / aurelia-semantic-ui / test / unit / collections / ui-menu_spec.js View on Github external
beforeEach(() => {
		component = StageComponent.
			withResources('src/collections/ui-menu');
	});
github ged / aurelia-semantic-ui / test / unit / collections / ui-breadcrumb_spec.js View on Github external
beforeEach(() => {
		component = StageComponent.
			withResources('src/collections/ui-breadcrumb');
	});

aurelia-testing

A collection of helpers for testing Aurelia apps and components.

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular aurelia-testing functions