Skip to content

Commit

Permalink
Merge pull request #1121 from UziTech/jasmine
Browse files Browse the repository at this point in the history
[WIP] Jasmine 3.1.0
  • Loading branch information
davisjam committed Mar 4, 2018
2 parents ad0585d + 9c6c13f commit 214468b
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Expand Up @@ -22,6 +22,7 @@
"env": {
"node": true,
"browser": true,
"amd": true
"amd": true,
"jasmine": true
}
}
11 changes: 11 additions & 0 deletions jasmine.json
@@ -0,0 +1,11 @@
{
"spec_dir": "test",
"spec_files": [
"**/*-spec.js"
],
"helpers": [
"helpers/**/*.js"
],
"stopSpecOnExpectationFailure": false,
"random": true
}
39 changes: 39 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -31,13 +31,18 @@
"eslint-plugin-standard": "^3.0.1",
"front-matter": "^2.3.0",
"glob-to-regexp": "0.3.0",
"jasmine": "^3.1.0",
"markdown": "*",
"markdown-it": "*",
"showdown": "*",
"uglify-js": "^3.3.10"
},
"scripts": {
"test": "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",
Expand Down
5 changes: 5 additions & 0 deletions test/integration/marked-spec.js
@@ -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 changes: 12 additions & 0 deletions test/specs/specs-spec.js
@@ -0,0 +1,12 @@
var specTests = require('../');

it('should run spec tests', function () {
// hide output
spyOn(console, 'log');
if (!specTests({stop: true})) {
// if tests fail rerun tests and show output
console.log.and.callThrough();
specTests();
fail();
}
});
7 changes: 7 additions & 0 deletions test/unit/marked-spec.js
@@ -0,0 +1,7 @@
var marked = require('../../lib/marked.js');

it('should run the test', function () {
spyOn(marked, 'parse').and.callThrough();
marked.parse('Hello World!');
expect(marked.parse).toHaveBeenCalled();
});

0 comments on commit 214468b

Please sign in to comment.