-
Notifications
You must be signed in to change notification settings - Fork 2
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
Browserify #9
base: master
Are you sure you want to change the base?
Browserify #9
Conversation
The purpose was to allow |
Will mocha.files ever be 0 in node? If not, we could use that as an
|
No it will be the name of the test file required |
This PR is now only blocked by mochajs/mocha#1905 |
Ok I see the tests pass. But you say it will not work in the browser is that correct? Could you rebase master? I added Travis integration just now |
Correct, this PR will not work yet, until the PR against mocha itself is I didn't bother adding any browser-specific tests yet, as I'm not sure what |
Yes tests for this would be needed. Apart from verifying the functionality they could also serve as a reference for how to set it up in the browser. But generally, I would not like to merge it until it actually works with mocha |
If you're looking for the browser tests to act as a reference, then it Definitely agree that this shouldn't be merged until mocha is updated. I'm On Mon, Sep 28, 2015 at 10:14 AM, Ludwig Magnusson <[email protected]
|
f38cc63
to
b0872ad
Compare
Waiting for mocha to reopen the PR |
do not merge
There are multiple components to this PR, and some of them will be extracted as separate PRs (since some changes aren't specific to browser functionality)
global
(this can be a separate PR. it is a standalone change)pre-require
andpost-require
events are given anull
value forfile
when invoked in the browser, so a default dummy value of'browser'
is usedprocessedFiles.length
guard will not work in the browser sincemocha.files
will be empty. However, I'm not sure of the purpose of this guard in node, so some alternative is necessary before this can be merged. For now, I've simply removed the guard and allowed eachprocessedFile
to be built into a mocha suite.post-require
hook be invoked manually just prior tomocha.run()
. For my testing, I have configured this manually, but I now have an open PR to Mocha which will do this automatically in the browser-distribution of mochanpm run build
) which drops the browser-build under/dist
(this dist file will either need to be included in the npm tarball on prepublish, or committed in github, or published to github as a release asset. I can configure another PR that does this automatically whenever a new version is released)require('mocha')
call is replaced with awindow.Mocha
shim. It should be assumed that if mocha-gwt is being used in the browser that mocha is included like a regular script and exists as the globalMocha
(which is indeed what is done in the browser distribution of mocha)