lundi 4 janvier 2016

Add test that checks all files are formatted correctly to Karma \ Travis

I'm implementing some tests for a project of mine using karma locally, and Travis for github tests integration (you can't merge pull requests unless all tests pass)

I really want to do the same for code formatting. I'm using jscs in order to lint the code.

I thought about adding a test for karma to check if jscs returned any problems with the project's files. I'll do a expect(jscsOutput).isEmpty() So the test will pass only if no formatting problems were found.

Is there a standard way of doing this? I saw there's a preprocessor for karma but as much as I was able to check, it doesn't make travis fail if any jscs errors were found.

Is there any better practice for this?

I couldn't find anything on the internet since karma.js test file formatting just returns a lot of results about how to correctly format your tests (readability)

Aucun commentaire:

Enregistrer un commentaire