aurelia / aurelia/cli

Webpack/Karma tests fail when related elements use slots

Open
#824 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
402
Forks
134
PR merge metrics
No merged PRs in 30d

Description

**I'm submitting a bug report**

* **Library Version:**
0.32.0

**Please tell us about your environment:**
* **Operating System:**
Windows 10

* **Node Version:**
8.9.4

* **NPM Version:**
5.5.1

* **Browser:**
Chrome 64.0.3282.140 (Official Build) (64-bit)

* **Language:**
all

* **Loader/bundler:**
Webpack

**Current behavior:**
Webpack/Karma projects fail to run tests that create elements that use slots.

* **What is the expected behavior?**
For valid tests to pass.

See https://github.com/jholland918/au-slot-20180211 reproducing this issue in the `au-webpack-babel-karma` directory. To prove this wasn't just a user mistake, I created `au-requirejs-babel-karma` and `au-webpack-babel-jest` in the above repo with the same test and both run successfully.

The output is vague, but once you dig into it you see some dep injection error with some class with 'slot' in the name. For what it's worth, here's the initial error that prints to the console:

```
...au-webpack-babel-karma> au karma
Starting 'karma'...

START:
11 02 2018 21:44:29.241:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
11 02 2018 21:44:29.250:INFO [launcher]: Starting browser Chrome
11 02 2018 21:44:32.469:INFO [Chrome 64.0.3282 (Windows 10.0.0)]: Connected on socket HP2JZ1jP9YyeICSLAAAA with id 39582214
Chrome 64.0.3282 (Windows 10.0.0): Executed 0 of 2 SUCCESS (0 secs / 0 secs)
the app
Chrome 64.0.3282 (Windows 10.0.0): Executed 1 of 2 SUCCESS (0 secs / 0 secs)
LOG: 'TypeError: Cannot read property 'innerHTML' of null'
Chrome 64.0.3282 (Windows 10.0.0): Executed 1 of 2 SUCCESS (0 secs / 0 secs)
home
Chrome 64.0.3282 (Windows 10.0.0) home says Lorem Ipsum FAILED
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Chrome 64.0.3282 (Windows 10.0.0): Executed 2 of 2 (1 FAILED) (5.039 secs / 0 secs)

Finished in 5.039 secs / 0 secs @ 21:44:38 GMT-0600 (Central Standard Time)

SUMMARY:
√ 1 test completed
× 1 test failed

FAILED TESTS:
home
× says Lorem Ipsum
Chrome 64.0.3282 (Windows 10.0.0)
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure in the linked repository's au-webpack-babel-karma directory and compare it with the au-requirejs-babel-karma and au-webpack-babel-jest projects, which reportedly pass. Investigate why the slot-based test fails under Webpack/Karma; done means valid tests that create elements using slots pass there.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.