diff --git a/test/index.js b/test/index.js index 51cbd4b..4af6c08 100644 --- a/test/index.js +++ b/test/index.js @@ -4,17 +4,17 @@ const assert = require('assert') const { it, describe } = require('mocha') const Metalsmith = require('metalsmith') const metadata = require('../lib') -const { name } = require('../package.json'); +const { name } = require('../package.json') describe('@metalsmith/metadata', function () { it('should export a named plugin function matching package.json name', function () { - const namechars = name.split('/')[1]; + const namechars = name.split('/')[1] const camelCased = namechars.split('').reduce((str, char, i) => { - str += namechars[i - 1] === '-' ? char.toUpperCase() : char === '-' ? '' : char; - return str; - }, ''); + str += namechars[i - 1] === '-' ? char.toUpperCase() : char === '-' ? '' : char + return str + }, '') assert.deepStrictEqual(metadata().name, camelCased) - }); + }) it('should parse JSON', function (done) { const m = Metalsmith('test/fixtures/json').use(metadata({ file: 'src/data.json' })) @@ -35,8 +35,8 @@ describe('@metalsmith/metadata', function () { }) it('should parse TOML', function (done) { - // run this test locally after running "npm i toml" - it.skip() + // run this test locally after running "npm i toml" & removing this.skip + this.skip() const m = Metalsmith('test/fixtures/toml').use(metadata({ file: 'src/data.toml' })) m.build(function (err) { if (err) return done(err) @@ -179,8 +179,8 @@ describe('@metalsmith/metadata', function () { }) it('should error when TOML is not installed', function (done) { - // run this test locally by removing it.skip & running "npm remove toml" - it.skip() + // run this test locally by removing this.skip & running "npm remove toml" + this.skip() const Metalsmith = require('metalsmith') Metalsmith('test/fixtures/toml') .use(metadata({ file: 'src/data.toml' }))