8000 npm: Fixed `test` script (#1809) · PrismJS/prism@bc649df · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit bc649df

Browse files
npm: Fixed test script (#1809)
This solves the problem that is wasn't possible to pass arguments to `tests/run.js`.
1 parent f2d8e1c commit bc649df

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"main": "prism.js",
66
"style": "themes/prism.css",
77
"scripts": {
8-
"test": "mocha tests/testrunner-tests.js && mocha tests/run.js && mocha tests/plugins/**/*.js"
8+
"test:runner": "mocha tests/testrunner-tests.js",
9+
"test:languages": "mocha tests/run.js",
10+
"test:plugins": "mocha tests/plugins/**/*.js",
11+
"test": "npm run test:runner && npm run test:languages && npm run test:plugins"
912
},
1013
"repository": {
1114
"type": "git",

test-suite.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ <h1>Running the test suite</h1>
3030
<section id="running-tests-for-specific-languages">
3131
<h2>Running tests for specific languages</h2>
3232

33-
<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>
34-
<p>You can even specify multiple languages: <code class="language-bash">npm test -- --language=markup --language=css</code>.</p>
33+
<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>
34+
<p>You can even specify multiple languages: <code class="language-bash">npm run test:languages -- --language=markup --language=css</code>.</p>
3535
</section>
3636
</section>
3737

@@ -121,7 +121,7 @@ <h2>Explaining the simplified token stream</h2>
121121
<li>All empty structures are removed.</li>
122122
</ul>
123123
<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>
124-
E.g. <code class="language-bash">npm test -- --pretty</code>.</p>
124+
E.g. <code class="language-bash">npm run test:languages -- --pretty</code>.</p>
125125
<p>For further information: reading the tests of the test runner (<code>tests/testrunner-tests.js</code>) will help you understand the transformation.</p>
126126
</section>
127127
</section>

0 commit comments

Comments
 (0)
0