Skip to content

Re-bundle karma test files when non-test JS files change.#1667

Merged
cramforce merged 1 commit intoampproject:masterfrom
cramforce:test-update
Jan 29, 2016
Merged

Re-bundle karma test files when non-test JS files change.#1667
cramforce merged 1 commit intoampproject:masterfrom
cramforce:test-update

Conversation

@cramforce
Copy link
Copy Markdown
Member

Not sure there is a better way to do this, but apparently karma only watches the test files themselves which is not really what one wants during test driven development or really ever.

Fixes #1623

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

@erwinmombay
Copy link
Copy Markdown
Member

not on my work comp right now so cant test, but how is the update->test cycle with the change?

@cramforce
Copy link
Copy Markdown
Member Author

@erwinmombay For me, updating a non-test JS file would without this change trigger a rerun on the tests, but it would not actually contain the changes. The rerun is caused by the gulp task rebuilding our dist directory which the tests only serve, but there is no rebuild.

With this change the difference is that on the next test run (that is automatically triggered) you actually do get your JS changes.

Not sure there is a better way to do this, but apparently karma only watches the test files themselves which is not really what one wants during test driven development or really ever.

Fixes ampproject#1623
@jridgewell
Copy link
Copy Markdown
Contributor

The issue is that we are only including our test files with karma.

@cramforce
Copy link
Copy Markdown
Member Author

But that is the right way to go it. I've seen lots of problems from just blindly including all these sources. If karma used watchify this problem would not exist. Would be certainly best to patch this upstream, but until then this is better.

@erwinmombay
Copy link
Copy Markdown
Member

@cramforce LGTM

cramforce added a commit that referenced this pull request Jan 29, 2016
Re-bundle karma test files when non-test JS files change.
@cramforce cramforce merged commit 7e2fc2b into ampproject:master Jan 29, 2016
@cramforce cramforce deleted the test-update branch January 29, 2016 21:22
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