Switch npm to Yarn (#1522)

* Add testUrl to jest config

* Switch npm to Yarn
This commit is contained in:
ylemkimon
2018-07-30 03:36:27 +09:00
committed by Kevin Barabash
parent 702b3c807f
commit a76c4b9a2f
16 changed files with 8010 additions and 13106 deletions

View File

@@ -58,7 +58,7 @@ single file. The goal is to have all functions use this new system.
## Testing
Local testing can be done by running the webpack-dev-server using configuration
`webpack.dev.js`. Run `npm install` to install dependencies, and then `npm start`
`webpack.dev.js`. Run `yarn install` to install dependencies, and then `yarn start`
to start the server.
This will host an interactive editor at
@@ -68,13 +68,13 @@ changes.
webpack-dev-server 2.8.0 introduced a change which included ES6 keywords `const`
and `let` within the scripts being served to the browser, and therefore doesn't
support IE 9 and 10. If you want to test in IE 9 and 10, install version 2.7.1
by running `npm install webpack-dev-server@2.7.1`.
by running `yarn add webpack-dev-server@2.7.1`.
#### Jest tests
The JavaScript parser and some of the HTML and MathML tree
builders are tested with Jest. These tests can be run using node with
`npm run test:jest`. If you need to debug the tests see
`yarn run test:jest`. If you need to debug the tests see
[https://facebook.github.io/jest/docs/troubleshooting.html](https://facebook.github.io/jest/docs/troubleshooting.html)
The interactive editor can also be used for debugging tests in the browser by
@@ -88,9 +88,9 @@ tests when you submit a pull request, in case you forget.
If you make any changes to Parser.js, add Jest tests to ensure they work.
Some tests verify the structure of the output tree using [snapshot testing](https://facebook.github.io/jest/docs/en/snapshot-testing.html).
Those snapshots can be updated by running `npm run test:jest:update`.
Those snapshots can be updated by running `yarn run test:jest:update`.
Also, test code coverage can be collected by `npm run test:jest:coverage`.
Also, test code coverage can be collected by `yarn run test:jest:coverage`.
You can view the report in `coverage/lcov-report/index.html`.
#### Screenshot tests
@@ -126,7 +126,7 @@ try to test in IE 9, using [modern.ie](http://modern.ie) VMs.
## Building
KaTeX is built using webpack with configuration `webpack.config.js`. Run
`npm run build` to build the project.
`yarn run build` to build the project.
## Style guide
@@ -141,12 +141,12 @@ Code
In general, try to make your code blend in with the surrounding code.
The code can be linted by running `npm run test:lint`, which lints JavaScript
The code can be linted by running `yarn run test:lint`, which lints JavaScript
files using ESLint and stylesheets using stylelint. They must pass to commit
the changes.
Some files have flowtype annotations and can be checked for type errors using
Flow by running `npm run test:flow`. See [Flow](https://flow.org/) for more details.
Flow by running `yarn run test:flow`. See [Flow](https://flow.org/) for more details.
## Pull Requests
@@ -160,7 +160,7 @@ Flow by running `npm run test:flow`. See [Flow](https://flow.org/) for more deta
The fonts for KaTeX live in a submodule stored in `submodules/katex-fonts`.
When you first clone the KaTeX repository, use
`git submodule update --init --recursive` to download the corresponding
fonts repository. After running `npm install`, you should have Git hooks that
fonts repository. After running `yarn install`, you should have Git hooks that
will automatically run this command after switching to branches
where `submodules/katex-fonts` point to different commits.