The issue at hand pertains to the transition of Aurelia from using core-js
to in-house polyfills. One notable absence is the Reflect polyfill, causing tests to fail.
In the Aurelia navigation skeleton app, this problem can be rectified by adding the following import statement to each unit test file:
import 'aurelia-polyfills';
To address this, I opted to create a separate file named setup.ts
(or setup.js
depending on your language) containing only this import statement. Subsequently, I included this file as the first item in karma.config.js
.
For JavaScript:
jspm : {
loadFiles: ['test/unit/setup.js', 'test/unit/**/*.js'],
...
}
For TypeScript:
files: ['test/unit/setup.ts', 'test/unit/**/*.ts'],
...