component-test icon indicating copy to clipboard operation
component-test copied to clipboard

Bring your own mocha.html

Open Swatinem opened this issue 11 years ago • 2 comments

Suppose you have some html fixtures or custom css that you need during your tests.

Like here: https://github.com/Swatinem/scrollbars/blob/master/test/index.html

Would be cool if you could bring your own mocha.html or whatever that should be called.

Swatinem avatar Dec 11 '13 16:12 Swatinem

+1 for things like using the history API. I would argue you that most DOM nodes should be created in a before or beforeEach and appended to the page.

IMO, It's not trivial to set up all the dependencies to make sure it works across browser, phantom, saucelabs, etc, so it should be avoided.

Your example brings up an interesting point though. It'd be nice to be able to bring in all the additional fixtures into the mocha.html or index.html

For now I think we could have an option, like --testpage or --mochapage index.html or something

matthewmueller avatar Dec 11 '13 17:12 matthewmueller

I would argue you that most DOM nodes should be created in a before or beforeEach and appended to the page.

True. It’s just much more convenient to do it in mocha.html. So it should be supported somehow.

Swatinem avatar Dec 11 '13 17:12 Swatinem