Summary
We'd like contributors to use the same linter and lint rules that we use
internally. This diff swaps out eslint for jshint and fixes all lint failures
except for the max-len failures in the test suites.
Test Plan:
- ka-lint src
- make lint
- make test
Reviewers: emily
Otherwise it could happen that some Mozilla page gets shown which has a
minimal size larger than the 786px we're requesting. And the screenshot
will span that entire page even if the window is smaller, resulting in a
failure to adjust screenshot size.
See http://kb.mozillazine.org/Browser.startup.homepage_override.mstone
and http://kb.mozillazine.org/Browser.startup.page for details.
Just in case, we also include the docker image digests in the travis build
log, to increase chances of reproducing what we get there.
This is almost like the align* environment, but it starts out in math mode,
so we don't have to worry about the fact that we have no real surrounding
text mode in KaTeX. This is the first step towards align* and align.
Instead of passing around the current position as an argument, we now have a
parser property called pos to keep track of that. Instead of repeatedly
re-lexing at the current position we now have a property called nextToken
which contains the token beginning at the current position. We may need to
re-lex if we switch mode. Since the position is kept in the parser state,
we don't need to return it from parsing methods, which obsoletes the
ParseResult class.
This is an attempt to actually exercise all the code paths which can lead to
a ParserError exception (from malformed user input, without tinkering with
any KaTeX internals or exploiting a KaTeX bug). It documents the current
state of affairs, without changing any error messages. Comments indicate
future work, particularly with respect to the position often associated with
these error messages.
Instead of having our own copy of jasmine in the repository, we use
jasmine-core as an npm dependency and load it from there. That reduces the
size of the repository and helps keeping up to date. We're not using the
transitive dependency on jasmine-core via jasmine, since the jasmine package
might change its dependency any day (although unlikely).
The katex-spec.js shipped from the server now includes all
`test/*[Ss]pec.js` (as matched via glob) so that additional spec files can
be created and will automatically get included in the browser-side test
suite. The contrib specs are not included at this point.
Visit http://0.0.0.0:7936/test/test.html while running server.js to see this
in action and verify the lack of failures.