0

When a test of ours has a syntax error we get something like this:

WARNING in ./tests/components/RequesterInfo/RequsterInfo.spec.js
Module build failed: SyntaxError: /Volumes/dev/VisualforceCore/tests/components/RequesterInfo/RequsterInfo.spec.js: Unexpected token, expected , (34:39)
  32 |             TimeZoneSidKey: 'America/Indiana/Indianapolis',
  33 |             Title: 'CTO',
> 34 |             SatisfactionLevel__c: value: 'Low',
     |                                        ^
  35 |           }
  36 |           fieldSet: {
  37 |             LanguageLocaleKey: { label: 'Language' },

We often miss this error as it gets swallowed up in all the output Can I make karma fail on a syntax error?

davegri
  • 2,206
  • 2
  • 26
  • 45
  • Common practice is to use a linter like jshint or eslint to validate syntax before the tests start to execute. – givanse Jan 24 '17 at 23:47
  • Possible duplicate of [How can I 'force' ALL karma test to fail if an eslint error is found?](http://stackoverflow.com/questions/39229441/how-can-i-force-all-karma-test-to-fail-if-an-eslint-error-is-found) – givanse Jan 25 '17 at 00:02

0 Answers0