Skip to content

Conversation

@youknowriad
Copy link
Contributor

As noted by @aduth mocha-webpack overrides the default webpack entry, so we'll have issues to make it work with our globals config.

  • In this PR, I'm replacing mocha-webpack with babel-register
  • Moving the tests close to the source code
  • Defining the globals for test in bootstrap-test.js

I avoided publishing directly to #289 PR in case you have objections here.

@youknowriad youknowriad added the Framework Issues related to broader framework topics, especially as it relates to javascript label Mar 21, 2017
@youknowriad youknowriad self-assigned this Mar 21, 2017
@youknowriad youknowriad requested review from aduth and nylen March 21, 2017 14:25
@aduth
Copy link
Member

aduth commented Mar 21, 2017

The downside of this approach is that it doesn't test files as accurately as if they were built from Webpack first (in case we incorporate custom loaders, etc). In my experience this has rarely been problematic, and the upside is that Mocha compilers tend to run much faster than first bundling (since fewer files are touched).

I found that assigning the globals shouldn't be needed, and tests run well without them (removed in 0f1ea2a). If you're seeing otherwise, I was thinking to consider whether this is a result of Webpack's output.libraryTarget (which has a few other options to try: window, global, etc.).

I'm personally fine with this approach but I'll defer to @nylen since he wanted the Webpack integration 👍

@nylen
Copy link
Member

nylen commented Mar 21, 2017

I'm personally fine with this approach but I'll defer to @nylen since he wanted the Webpack integration 👍

I just wanted to try it that way because it seemed potentially cleaner than using babel. I'll merge this into #289.

@nylen nylen merged commit 0f1ea2a into update/implement-block-registering Mar 21, 2017
@nylen nylen deleted the fix/test-infra branch March 21, 2017 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Framework Issues related to broader framework topics, especially as it relates to javascript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants