run flow as part of 'npm test' so it runs on travis-ci

This commit is contained in:
Kevin Barabash
2017-08-19 22:35:42 -04:00
committed by Kevin Barabash
parent d8116bdc64
commit 6db61cb219
3 changed files with 11 additions and 2 deletions

View File

@@ -101,6 +101,9 @@ compress: build/katex.min.js build/katex.min.css
serve: $(NIS) serve: $(NIS)
$(NODE) server.js $(NODE) server.js
flow: $(NIS)
node_modules/.bin/flow
test: $(NIS) test: $(NIS)
node_modules/.bin/jest node_modules/.bin/jest

View File

@@ -46,8 +46,8 @@
}, },
"bin": "cli.js", "bin": "cli.js",
"scripts": { "scripts": {
"test": "make lint test",
"lint": "make lint", "lint": "make lint",
"test": "make lint flow test",
"prepublish": "make NIS= dist" "prepublish": "make NIS= dist"
}, },
"pre-commit": [ "pre-commit": [

View File

@@ -56,6 +56,10 @@ type FunctionSpec<T> = {
// (default false) // (default false)
allowedInText?: boolean, allowedInText?: boolean,
// Whether or not the function is allowed inside text mode
// (default true)
allowedInMath?: boolean,
// (optional) The number of optional arguments the function // (optional) The number of optional arguments the function
// should parse. If the optional arguments aren't found, // should parse. If the optional arguments aren't found,
// `null` will be passed to the handler in their place. // `null` will be passed to the handler in their place.
@@ -115,7 +119,9 @@ export default function defineFunction({
argTypes: props.argTypes, argTypes: props.argTypes,
greediness: (props.greediness === undefined) ? 1 : props.greediness, greediness: (props.greediness === undefined) ? 1 : props.greediness,
allowedInText: !!props.allowedInText, allowedInText: !!props.allowedInText,
allowedInMath: props.allowedInMath, allowedInMath: (props.allowedInMath === undefined)
? true
: props.allowedInMath,
numOptionalArgs: props.numOptionalArgs || 0, numOptionalArgs: props.numOptionalArgs || 0,
infix: !!props.infix, infix: !!props.infix,
handler: handler, handler: handler,