mirror of
https://github.com/markedjs/marked
synced 2024-11-23 18:02:12 +00:00
add tests
This commit is contained in:
parent
dce66a2849
commit
79325aa9e1
@ -38,9 +38,11 @@
|
||||
"uglify-js": "^3.3.10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "npm run test:unit && npm run test:spec",
|
||||
"test:unit": "jasmine --config=jasmine.json",
|
||||
"test:spec": "node test",
|
||||
"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:old": "node test",
|
||||
"test:lint": "eslint lib/marked.js test/index.js",
|
||||
"bench": "node test --bench",
|
||||
"lint": "eslint --fix lib/marked.js test/index.js",
|
||||
|
5
test/integration/marked-spec.js
Normal file
5
test/integration/marked-spec.js
Normal file
@ -0,0 +1,5 @@
|
||||
var marked = require('../../marked.min.js');
|
||||
|
||||
it('should run the test', function () {
|
||||
expect(marked('Hello World!')).toBe('<p>Hello World!</p>\n');
|
||||
});
|
12
test/specs/specs-spec.js
Normal file
12
test/specs/specs-spec.js
Normal file
@ -0,0 +1,12 @@
|
||||
var tests = require('../');
|
||||
|
||||
it('should run spec tests', function () {
|
||||
// hide output
|
||||
spyOn(console, 'log');
|
||||
if (!tests.runTests({stop: true})) {
|
||||
// if tests fail rerun tests and show output
|
||||
console.log.and.callThrough();
|
||||
tests.runTests();
|
||||
fail();
|
||||
}
|
||||
});
|
@ -1,5 +1,7 @@
|
||||
var marked = require('../../lib/marked.js');
|
||||
|
||||
it('should run the test', function () {
|
||||
expect(marked('Hello World!')).toContain('Hello World!');
|
||||
spyOn(marked, 'parse').and.callThrough();
|
||||
marked.parse('Hello World!');
|
||||
expect(marked.parse).toHaveBeenCalled();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user