h5bp/mobile-boilerplate

Consider re-introducing test

Closed this issue · 11 comments

In 4989cf9 tests were removed from the repo. I want to suggest to re-introduce them in a lightweight form for helper.js since there is a lot of functionality.
I think it is important to have some tests for the functions we write. Also it might help people get started with tests on their projects.
Keeping them maintained shouldn't be that much of a problem I think.

If there is a need for that I would love to submit a PR.

Problem with tests is that this is a starter template, most people don't use tests, most people don't want us imposing a test framework on them, etc. The reasons for removal still stand.

In some ways helper.js needs to be rethought entirely to move away from a monolithic file that existing within this repo.

cc @alexgibson - thoughts on this?

My view is that helper.js in its current state is a bit of a mess. I would like to see it restructured in some way, so it can be maintained in a more modular way perhaps. This would also make it more suitable for a test suite, which I think is a good idea - more so for our benefit (and for anyone who wants to contribute). You're right that most people would not have a use for it, but for something like helper.js I think it still warrants consideration.

What if we broke it out into a separate repo or simply consumed other projects that already address those features.

I quite like the idea of consuming other open source projects for these features - there are numerous alternatives to fastButton, scaleFix etc… that arguably do it better? Maybe we could compile a list of alternatives and see.

Yes, I like the idea. Could it be something we should track in another bug for the next major release? Seems to work pretty good for HTML5 BP.

Opened a new issue for this to discuss :)

FWIW, I think Hans is right. If there is anything that could do with testing in this repo (for our purposes rather than "he's a test framework you should use"), we should consider it doing so. This repo doesn't necessarily have to be tied to the same constraints that we have with the HTML5 Boilerplate.

Agreed - once we decide on #164 we should revisit this, and see if we can write tests for any methods that remain.

There are some mobile frameworks out there like Ratchet that provide some of the functionality that is needed for mobile development. Question is where we draw the line to call it a "boilerplate".
Is it necessary to scroll to the top of a page in 95% of mobile web-pages? If yes, it should be part of the boilerplate. And if it's in, it should be tested.

HTML5BP is clearly set to provide the minimum. I think the target for the Mobile Boilerplate project still needs to be defined.
:)