Skip to content
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

fix: failing build due to no tests #17

Merged
merged 2 commits into from
Dec 29, 2016
Merged

fix: failing build due to no tests #17

merged 2 commits into from
Dec 29, 2016

Conversation

frederikprijck
Copy link
Contributor

@frederikprijck frederikprijck commented Dec 28, 2016

Travis seems to fail on new builds: https://travis-ci.org/HNeukermans/adal-ts/jobs/184817620

17 12 2016 19:37:28.799:WARN [watcher]: Pattern "/home/travis/build/HNeukermans/adal-ts/*.spec.ts" does not match any file.
17 12 2016 19:37:28.804:WARN [watcher]: Pattern "/home/travis/build/HNeukermans/adal-ts/*.spec.ts" does not match any file.
17 12 2016 19:37:28.832:INFO [karma]: Karma v1.3.0 server started at http://localhost:9876/
17 12 2016 19:37:28.832:INFO [launcher]: Launching browser Chrome with unlimited concurrency
17 12 2016 19:37:28.840:INFO [launcher]: Starting browser Chrome
17 12 2016 19:37:30.891:INFO [Chromium 37.0.2062 (Ubuntu 0.0.0)]: Connected on socket /#6CekorrepbnYU8sGAAAA with id 2759752
Chromium 37.0.2062 (Ubuntu 0.0.0): Executed 0 of 0 SUCCESS (0 secs / 0 secs)
ium 37.0.2062 (Ubuntu 0.0.0): Executed 0 of 0 ERROR (0.002 secs / 0 secs)
Chromium 37.0.2062 (Ubuntu 0.0.0): Executed 0 of 0 ERROR (0.002 secs / 0 secs)
npm ERR! Test failed.  See above for more details.

After cloning the repository locally I stumbled upon the following error in awesome-typescript-loader:

Cannot read property 'exclude' of undefined

More info:

Basicly I locked down the TS version to the one specified in package.json (2.0.10). If you want I can update the PR to target TypeScript 2.1.1 or even go with a beta of awesome typescript loader (^3.0.0-beta.9) and use TypeScript 2.1.4.

Apart from that I also changed the way karma looks for the tests, as described in https://webpack.github.io/docs/usage-with-karma.html.

Without changing it karma didn't want to find any spec file. But I'm guessing there's something wrong with webpack versioning in package.json.
The package.json files requires "webpack": "^1.13.0" and "awesome-typescript-loader": "^2.2.4",. But the docs of awesome-typescript-loader clearly states:

[email protected] aims to support only [email protected] and webpack@2x, if you need old compilers please use 1.x or 0.x versions.

More info: https://github.com/s-panferov/awesome-typescript-loader

Changing the way karma looks for the spec files was the easiest fix. However, i'd like to undo this change and update to webpack 2. But I wanted to create this PR in order to also discuss this webpack version thing/issue.

What webpack version is the project supposed to be using?

@coveralls
Copy link

coveralls commented Dec 28, 2016

Coverage Status

Changes Unknown when pulling 405c158 on frederikprijck:fix/build into ** on HNeukermans:master**.

@frederikprijck
Copy link
Contributor Author

frederikprijck commented Dec 28, 2016

Oops, I forgot to exclude the karma.specs.js from .gitignore. I've added the file in the second commit, that's why the first one is still failing on Travis.

@HNeukermans
Copy link
Owner

Dear Frederik,

thx for the contribution. Very happy to see the build passing and the tests running again.
I will merge this request into the master, as this is already a valuable contribution to the project.

Furthermore, if I understand correctly, you propose to solve both build + spec detection issues by migrating towards webpack 2 ?!! Very much looking forward to your new contribution.

@HNeukermans HNeukermans merged commit c9aed99 into HNeukermans:master Dec 29, 2016
@frederikprijck
Copy link
Contributor Author

Building locally would have always been an issue with the current master dependencies, as TypeScript 2.1.4 doesn't work well with the version of awesome-typescript-loader.

I'm not sure if upgrading to webpack 2 will solve things. But as I can see, the used version of the awesome-typescript-loader isn't supposed to work with webpack 1, currently being used by ur project.

@frederikprijck frederikprijck deleted the fix/build branch December 29, 2016 12:25
@frederikprijck
Copy link
Contributor Author

frederikprijck commented Dec 29, 2016

I think the reason why karma fails to load tests is due to: codymikol/karma-webpack#188

To test this, I changed karma config to use PhantomJS and Chrome, and the tests are found using the original way again.

So I'd leave the new-way of discovering spec files in place for now if you want to keep using chrome for running the tests ... (there's nothing wrong with that new-way of discovering spec files anyway)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants