move cm tests
This commit is contained in:
parent
9b2a49f821
commit
db71a7f3b5
@ -43,7 +43,7 @@
|
||||
"test": "jasmine --config=jasmine.json",
|
||||
"test:unit": "npm test -- test/unit/**/*-spec.js",
|
||||
"test:specs": "npm test -- test/specs/**/*-spec.js",
|
||||
"test:integration": "npm test -- test/integration/**/*-spec.js",
|
||||
"test:cm": "npm test -- test/specs/commonmark/**/*-spec.js",
|
||||
"test:old": "node test",
|
||||
"test:lint": "eslint bin/marked .",
|
||||
"bench": "node test --bench",
|
||||
|
@ -1,5 +1,5 @@
|
||||
var marked = require('../../lib/marked.js');
|
||||
var cmSpec = require('./commonmark.json');
|
||||
var marked = require('../../../lib/marked.js');
|
||||
var cmSpec = require('./commonmark.0.28.json');
|
||||
var HtmlDiffer = require('html-differ').HtmlDiffer,
|
||||
htmlDiffer = new HtmlDiffer();
|
||||
var since = require('jasmine2-custom-message');
|
||||
@ -11,13 +11,14 @@ Messenger.prototype.message = function(spec, expected, actual) {
|
||||
}
|
||||
|
||||
Messenger.prototype.test = function(spec, section, ignore) {
|
||||
if (spec.section === section && ignore.indexOf(spec.example) < 0) {
|
||||
it('should pass example ' + spec.example, function() {
|
||||
if (spec.section === section) {
|
||||
var shouldFail = ~ignore.indexOf(spec.example);
|
||||
it('should ' + (shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, function() {
|
||||
var expected = spec.html;
|
||||
var actual = marked(spec.markdown, { headerIds: false, xhtml: true });
|
||||
since(messenger.message(spec, expected, actual)).expect(
|
||||
htmlDiffer.isEqual(expected, actual)
|
||||
).toEqual(true);
|
||||
).toEqual(!shouldFail);
|
||||
});
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
var specTests = require('../');
|
||||
var specTests = require('../../');
|
||||
|
||||
it('should run spec tests', function () {
|
||||
// hide output
|
Loading…
x
Reference in New Issue
Block a user