Aurelia-Testing with Jasmine/Karma Fails


We have attempted to get the example running as described by:

However, the code inside the component.create(bootstrap).then() block does not execute. As a consequence of the component creation failing, component.dispose(); also fails, since it cannot dispose of a component that has not been created.

Using Chrome, the console displays ‘Uncaught (in promise) Error: Unable to find module with ID: aurelia-pal-browser’.

We are unable to resolve this. The platform is Windows 10, and we are using aurelia-testing (1.0.0-beta.4.0.0) and aurelia-pal-browser (1.8.0).

Any help would be appreciated.


So the actual code snippet is this one:

import {StageComponent} from ‘aurelia-testing’;
import {bootstrap} from ‘aurelia-bootstrapper’;

describe('MyComponent', () => {
  let component;

  beforeEach(() => {
    component = StageComponent
      .inView('<my-component first-name.bind="firstName"></my-component>')
      .boundTo({ firstName: 'Bob' });

  it('should render first name', done => {
    component.create(bootstrap).then(() => {
      const nameElement = document.querySelector('.firstName');
    }).catch(e => { console.log(e.toString()) });

  afterEach(() => {

Interestingly, there is a reference to the PAL browser inside the webpack. So why can’t the framework find it?


Try it with:

 component = StageComponent


There’s no functional difference with that change in. Still get the same error.

I don’t believe it is the test example code. I think the framework has an issue for some reason. Here’s the error and last part of the stack trace (i.e. framework code issuing the error).



And in our webpack, app.js, here is the only reference I can find to the PAL browser.

Any thoughts? Does that look correct?