Skip to content

Commit ba26457

Browse files
authored
Merge pull request #1002 from UziTech/test-fix
All right. LGTM! Easy to change in future without affecting our users...rollback or something else. And confirmed. Again, awesome work. Thank you.
2 parents 54f8f7b + 33b8848 commit ba26457

File tree

176 files changed

+209
-4412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+209
-4412
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules/
2+
test/compiled_tests

README.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -322,23 +322,19 @@ features][gfmf].
322322

323323
## Benchmarks
324324

325-
node v0.8.x
325+
node v8.9.4
326326

327327
``` bash
328-
$ node test --bench
329-
marked completed in 3411ms.
330-
marked (gfm) completed in 3727ms.
331-
marked (pedantic) completed in 3201ms.
332-
robotskirt completed in 808ms.
333-
showdown (reuse converter) completed in 11954ms.
334-
showdown (new converter) completed in 17774ms.
335-
markdown-js completed in 17191ms.
328+
$ npm run bench
329+
marked completed in 3408ms.
330+
marked (gfm) completed in 3465ms.
331+
marked (pedantic) completed in 3032ms.
332+
showdown (reuse converter) completed in 21444ms.
333+
showdown (new converter) completed in 23058ms.
334+
markdown-it completed in 3364ms.
335+
markdown.js completed in 12090ms.
336336
```
337337

338-
__Marked is now faster than Discount, which is written in C.__
339-
340-
For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects.
341-
342338
### Pro level
343339

344340
You also have direct access to the lexer and parser if you so desire.
@@ -373,23 +369,23 @@ suite. If you're adding a new feature, be sure to add your own test.
373369
The marked test suite is set up slightly strangely: `test/new` is for all tests
374370
that are not part of the original markdown.pl test suite (this is where your
375371
test should go if you make one). `test/original` is only for the original
376-
markdown.pl tests. `test/tests` houses both types of tests after they have been
377-
combined and moved/generated by running `node test --fix` or `marked --test
378-
--fix`.
372+
markdown.pl tests.
379373
380-
In other words, if you have a test to add, add it to `test/new/` and then
381-
regenerate the tests with `node test --fix`. Commit the result. If your test
374+
In other words, if you have a test to add, add it to `test/new/`. If your test
382375
uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you
383-
can add `.nogfm` to the filename. So, `my-test.text` becomes
384-
`my-test.nogfm.text`. You can do this with any marked option. Say you want
385-
line breaks and smartypants enabled, your filename should be:
386-
`my-test.breaks.smartypants.text`.
376+
can add [front-matter](https://www.npmjs.com/package/front-matter) to the top of
377+
your `.md` file
378+
379+
``` yml
380+
---
381+
gfm: false
382+
---
383+
```
387384
388385
To run the tests:
389386
390387
``` bash
391-
cd marked/
392-
node test
388+
npm run test
393389
```
394390
395391
### Contribution and License Agreement

marked.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"devDependencies": {
2626
"markdown": "*",
2727
"showdown": "*",
28+
"markdown-it": "*",
29+
"front-matter": "^2.3.0",
2830
"gulp": "^3.8.11",
2931
"gulp-uglify": "^1.1.0",
3032
"gulp-concat": "^2.5.2"

0 commit comments

Comments
 (0)