-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit test helpers not loaded correctly when using SystemJS #648
Comments
I wonder why this isn't needed for the skeletons. Is it because of |
Yes....however However we need the ability to define by package because the amodoro bundle contains module names that do not include the extension - everything in Make sense? |
It does. Could you put together a PR? |
Yes, will do.
… On 14/06/2017, at 17:38, Jeroen Vinke ***@***.***> wrote:
It does. Could you put together a PR?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
An import of a unit test _helper_ module from within a spec was failing (e.g. a module that defines a mock). This was due to the import statement normalization result not having a .js extension. This change splits aurelia-karma into two loader specific implementations, with the SystemJS version adding a package configuration for the base/test path that sets `defaultExtension` to js. `au new` adds an implementation based on the selected loader. closes aurelia#648
An import of a unit test _helper_ module from within a spec was failing (e.g. a module that defines a mock). This was due to the import statement normalization result not having a .js extension. This change splits aurelia-karma into two loader specific implementations, with the SystemJS version adding a package configuration for the base/test path that sets `defaultExtension` to js. `au new` adds an implementation based on the selected loader. closes aurelia#648
An import of a unit test _helper_ module from within a spec was failing (e.g. a module that defines a mock). This was due to the import statement normalization result not having a .js extension. This change splits aurelia-karma into two loader specific implementations, with the SystemJS version adding a package configuration for the base/test path that sets `defaultExtension` to js. `au new` adds an implementation based on the selected loader. closes aurelia#648
fix(systemjs-loader): systemjs config for karma test runner
@JeroenVinke I have found a case where
au test
will break when using SystemJS......but I also have the solution, just wanted to run past you...If you define a module in the test folder (for example a mock) and then import that into your test, it does not get loaded (404's). e.g. add
/test/unit/helper.js
then inapp.spec.js
addimport {MyMock} from './helper';
. This is because it is not defined in the bundle, and/base/test/unit/helper
does not resolve to anything.All that is needed is a SystemJS package definition added to config that sets the
defaultExtension
property:Currently
aurelia-karma.js
hasnormalizePath
andpatchRequireJS
which aren't actually used by SystemJS and this file seems like the appropriate place to add the required SystemJS config. Was thinking I could just addaurelia-karma.system.js
andaurelia-karma.require.js
as I did with index.html so thatau new
adds the appropriate setup.....thoughts?The text was updated successfully, but these errors were encountered: