Skip to content

Testing Components is out of sync with latest Aurelia #441

@baerrach

Description

@baerrach

I'm submitting a bug report
https://aurelia.io/docs/testing/components#testing-a-custom-element

  • Library Version:
    "aurelia-cli": "^1.0.2",

Current behavior:
After running au new and pasting in the examples from the testing component page they fail with the error

 FAIL  src/my-component.spec.js (5.961s)
  ● Console

    console.error internal/process/next_tick.js:68
      { Error: Cannot find module 'C:\path\to\project\test\unit\src\my-component' from 'aurelia-loader-nodejs.js'

Expected/desired behavior:

It should be looking for the component in src/my-component and not test/unit/src/my-component

Changing the line

-  .withResources('src/my-component')
+  .withResources('my-component')

Fixed the problem.

Note there is an info box for Karma that says "If you are using karma and your configuration already has a path for '*': 'src/*' set you may not need to use src/, and just my-component." It looks like for the default out-of-the-box that the src/ prefix is not needed now for the default Jest configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions