Skip to content

Commit

Permalink
npm: Fixed test script (#1809)
Browse files Browse the repository at this point in the history
This solves the problem that is wasn't possible to pass arguments to `tests/run.js`.
  • Loading branch information
RunDevelopment committed Mar 14, 2019
1 parent f2d8e1c commit bc649df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"main": "prism.js",
"style": "themes/prism.css",
"scripts": {
"test": "mocha tests/testrunner-tests.js && mocha tests/run.js && mocha tests/plugins/**/*.js"
"test:runner": "mocha tests/testrunner-tests.js",
"test:languages": "mocha tests/run.js",
"test:plugins": "mocha tests/plugins/**/*.js",
"test": "npm run test:runner && npm run test:languages && npm run test:plugins"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions test-suite.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ <h1>Running the test suite</h1>
<section id="running-tests-for-specific-languages">
<h2>Running tests for specific languages</h2>

<p>To run the tests only for one language, you can use the <code>language</code> parameter: <code class="language-bash">npm test -- --language=markup</code>.</p>
<p>You can even specify multiple languages: <code class="language-bash">npm test -- --language=markup --language=css</code>.</p>
<p>To run the tests only for one language, you can use the <code>language</code> parameter: <code class="language-bash">npm run test:languages -- --language=markup</code>.</p>
<p>You can even specify multiple languages: <code class="language-bash">npm run test:languages -- --language=markup --language=css</code>.</p>
</section>
</section>

Expand Down Expand Up @@ -121,7 +121,7 @@ <h2>Explaining the simplified token stream</h2>
<li>All empty structures are removed.</li>
</ul>
<p>To get a pretty-printed version of the simplified token stream of a failed test, add the <code>--pretty</code> modifier. Keep in mind that the pretty-printed token stream is indented using spaces, you may need to convert these to tabs. (Most editors today have an option which handles the conversion for you.)<br>
E.g. <code class="language-bash">npm test -- --pretty</code>.</p>
E.g. <code class="language-bash">npm run test:languages -- --pretty</code>.</p>
<p>For further information: reading the tests of the test runner (<code>tests/testrunner-tests.js</code>) will help you understand the transformation.</p>
</section>
</section>
Expand Down

0 comments on commit bc649df

Please sign in to comment.