Closed michaelbull closed 7 years ago
This is TS issue I think, since we need the Aurelia type but can't import that library into the bootstrapper's code. We'll need to investigate how best to solve this since TS doesn't have any notion of Type info without code import...at least not that I'm aware of.
A current workaround to prevent the error from being printed in the console is to cast bootstrap to any, e.g. component.create(bootstrap as any).then(() => {
.
This then leads to the following error, but it's only printed once and not for every test using the bootstrap function:
WARNING in ./~/aurelia-bootstrapper/dist/commonjs/aurelia-bootstrapper.js
Critical dependencies:
68:13-20 require function is used in a way in which dependencies cannot be statically extracted
@ ./~/aurelia-bootstrapper/dist/commonjs/aurelia-bootstrapper.js 68:13-20
I'm submitting a bug report
1.0.0-beta.2.0.0
Please tell us about your environment:
Operating System: Linux (debian jessie)
Node Version: 6.4.0
NPM Version: 3.10.3
Webpack AND Version webpack 1.13.3
Browser: Chrome 54.0.2840.71 m
Language: TypeScript 2.0.6
Current behavior:
Expected/desired behavior:
The bootstrap function has the the following method signature:
bootstrap(configure: Function): Promise<void>
, but the create method in aurelia-testing expects a bootstrap method of type(aurelia: Aurelia) => Promise<void>
.This creates a type exception as pasted above.
This can be reproduced by following the official documentation (in TypeScript) for testing a custom element.
The type definitions should be corrected to not produce this error every time tests are ran.