GithubHelp home page GithubHelp logo

alekseykulikov / browserify-test Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 2.0 140 KB

An easy way to test front-end libraries using browserify and mocha

License: MIT License

JavaScript 99.78% HTML 0.22%
browserify mocha testing

browserify-test's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

browserify-test's Issues

Customizing `browserify`

Hiya @alekseykulikov ...

I've been intrigued by all the magic in browserify-test and looking to add the same.

However, I'm wondering whether you might be inclined to add support for plugins (like mapstraction which I finds works nicely with uglifyify to get minified distribution files with external source maps that preserve references to the original source files (so, e.g., Chrome can display them and potentially allow editing of them during debugging).)

I think it may also be nice to have a hook to both supply browserify args and write the intermediate stream to disk so that, e.g., while setting up browser testing, one can also ensure distribution files are kept up to date without an extra call to browserify.

Maybe your exported module in index.js could simply return b to allow for additional steps?

(Sorry if any of this is off base, as I haven't tried your code yet, but seems like it might work.)

Utilize source map data in Testem's PhantomJS stack traces and logs

While I reported my main concern already at testem/testem#1095 , this TDD issue is I think particularly critical with browserify-test as we always assume a bundle so I thought you might be interested in tracking it here as well. Note that passing debug: true with browserifyOptions is not currently sufficient as PhantomJS simply will not use the source map info.

My limited testing also seems to suggest that Safari (at least 10.0.3) will only preserve source maps if we change your monkey-patch of Server.prototype.serveHomePage to write the user's browserified bundle buffer to an external file. As mentioned in the referenced issue, even here in Safari (as opposed to PhantomJS), it doesn't list the source line numbers in test error reporting, but it at least lists the source maps in console. I'd also therefore like to know whether you'd be open to a PR to preserve those source maps?

Consider using Electron over PhantomJS

Others have described Electron as more modern than PhantomJS.

If this is correct and means it is kept more up to date with the latest browser features than PhantomJS (because of its use of Chromium over Webkit?), I would think, assuming its features can be adequately tapped from Testem (and there is at least one type of Electron use case supported in Testem's examples), I'd think this would be best to support and set as the default.

I just keep running into problems with PhantomJS not supporting the latest XYZ feature and would love to see some way around this.

(And in case it may bear some relevance, I see there is this too: https://www.npmjs.com/package/electron-mocha )

Remove testem output from `npm test`

Bonus: also for some reason order of tests is important, for some reason mocha test/index.js test/cli.js fails, because test/index.js haven't released 7357 port.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.