diff --git a/test/helpers/helpers.js b/test/helpers/helpers.js index 25f0f4b63c..5395a5310f 100644 --- a/test/helpers/helpers.js +++ b/test/helpers/helpers.js @@ -2,13 +2,13 @@ const marked = require('../../'); const HtmlDiffer = require('@markedjs/html-differ').HtmlDiffer; const htmlDiffer = new HtmlDiffer({ignoreSelfClosingSlash: true}); -beforeEach(function () { +beforeEach(() => { marked.setOptions(marked.getDefaults()); jasmine.addMatchers({ - toRender: function () { + toRender: () => { return { - compare: function (spec, expected) { + compare: (spec, expected) => { const result = {}; const actual = marked(spec.markdown, spec.options); result.pass = htmlDiffer.isEqual(expected, actual); diff --git a/test/specs/original/specs-spec.js b/test/specs/original/specs-spec.js index d0869dd472..a3a1df437c 100644 --- a/test/specs/original/specs-spec.js +++ b/test/specs/original/specs-spec.js @@ -1,6 +1,6 @@ var specTests = require('../../'); -it('should run spec tests', function () { +it('should run spec tests', () => { // hide output spyOn(console, 'log'); if (!specTests(['', '', '--stop'])) { diff --git a/test/specs/run-spec.js b/test/specs/run-spec.js index 809ae10ce2..b827a0dcf0 100644 --- a/test/specs/run-spec.js +++ b/test/specs/run-spec.js @@ -8,14 +8,14 @@ function runSpecs(title, file, options) { return obj; }, {}); - describe(title, function() { + describe(title, () => { Object.keys(specs).forEach(section => { - describe(section, function() { - specs[section].forEach(function(spec) { + describe(section, () => { + specs[section].forEach((spec) => { if (options) { spec.options = Object.assign({}, options, (spec.options || {})); } - (spec.only ? fit : it)('should ' + (spec.shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, function() { + (spec.only ? fit : it)('should ' + (spec.shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, () => { if (spec.shouldFail) { expect(spec).not.toRender(spec.html); } else { diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js index c365e8599c..994c5dc8d7 100644 --- a/test/unit/marked-spec.js +++ b/test/unit/marked-spec.js @@ -1,41 +1,41 @@ var marked = require('../../lib/marked.js'); -describe('Test heading ID functionality', function() { - it('should add id attribute by default', function() { +describe('Test heading ID functionality', () => { + it('should add id attribute by default', () => { var renderer = new marked.Renderer(); var slugger = new marked.Slugger(); var header = renderer.heading('test', 1, 'test', slugger); expect(header).toBe('