diff options
| author | Marak <[email protected]> | 2021-03-22 16:31:25 -0400 |
|---|---|---|
| committer | Marak <[email protected]> | 2021-03-22 16:31:25 -0400 |
| commit | 10dd7e30cf49f03c34da1ab540df2172be40c8ea (patch) | |
| tree | a2ebc6179065775a9466a2148eb05a00fe6d23f7 /test/lorem.unit.js | |
| parent | 0b75623dac94f6062ae623fa8bbfe0e81b205d4d (diff) | |
| download | faker-10dd7e30cf49f03c34da1ab540df2172be40c8ea.tar.xz faker-10dd7e30cf49f03c34da1ab540df2172be40c8ea.zip | |
Linting fixes for `./test`
Diffstat (limited to 'test/lorem.unit.js')
| -rw-r--r-- | test/lorem.unit.js | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/test/lorem.unit.js b/test/lorem.unit.js index d7853a4b..7902077e 100644 --- a/test/lorem.unit.js +++ b/test/lorem.unit.js @@ -1,88 +1,88 @@ if (typeof module !== 'undefined') { - var assert = require('assert'); - var sinon = require('sinon'); - var faker = require('../index'); + var assert = require('assert'); + var sinon = require('sinon'); + var faker = require('../index'); } describe("lorem.js", function () { - describe("word()", function () { + describe("word()", function () { - context("when no 'length' param passed in", function () { - it("returns a word with a random length", function () { - var str = faker.lorem.word(); - assert.ok(typeof str === 'string'); - }); - }); + context("when no 'length' param passed in", function () { + it("returns a word with a random length", function () { + var str = faker.lorem.word(); + assert.ok(typeof str === 'string'); + }); + }); - context("when 'length' param passed in", function () { - it("returns a word with the requested length", function () { - var str = faker.lorem.word(5); - assert.ok(typeof str === 'string'); - assert.strictEqual(str.length, 5); - }); - }); + context("when 'length' param passed in", function () { + it("returns a word with the requested length", function () { + var str = faker.lorem.word(5); + assert.ok(typeof str === 'string'); + assert.strictEqual(str.length, 5); + }); }); + }); - describe("words()", function () { - beforeEach(function () { - sinon.spy(faker.helpers, 'shuffle'); - }); - - afterEach(function () { - faker.helpers.shuffle.restore(); - }); + describe("words()", function () { + beforeEach(function () { + sinon.spy(faker.helpers, 'shuffle'); + }); - context("when no 'num' param passed in", function () { - it("returns three words", function () { - var str = faker.lorem.words(); - var words = str.split(' '); - assert.ok(Array.isArray(words)); - assert.strictEqual(true, words.length >= 3); - // assert.ok(faker.helpers.shuffle.called); - }); - }); + afterEach(function () { + faker.helpers.shuffle.restore(); + }); - context("when 'num' param passed in", function () { - it("returns requested number of words", function () { - var str = faker.lorem.words(7); - var words = str.split(' '); - assert.ok(Array.isArray(words)); - assert.strictEqual(words.length, 7); - }); - }); + context("when no 'num' param passed in", function () { + it("returns three words", function () { + var str = faker.lorem.words(); + var words = str.split(' '); + assert.ok(Array.isArray(words)); + assert.strictEqual(true, words.length >= 3); + // assert.ok(faker.helpers.shuffle.called); + }); }); - describe("slug()", function () { - beforeEach(function () { - sinon.spy(faker.helpers, 'shuffle'); - }); + context("when 'num' param passed in", function () { + it("returns requested number of words", function () { + var str = faker.lorem.words(7); + var words = str.split(' '); + assert.ok(Array.isArray(words)); + assert.strictEqual(words.length, 7); + }); + }); + }); - afterEach(function () { - faker.helpers.shuffle.restore(); - }); + describe("slug()", function () { + beforeEach(function () { + sinon.spy(faker.helpers, 'shuffle'); + }); - var validateSlug = function (wordCount, str) { - assert.strictEqual(1, str.match(/^[a-z][a-z-]*[a-z]$/).length); - assert.strictEqual(wordCount - 1, str.match(/-/g).length); - }; + afterEach(function () { + faker.helpers.shuffle.restore(); + }); - context("when no 'wordCount' param passed in", function () { - it("returns a slug with three words", function () { - var str = faker.lorem.slug(); - validateSlug(3, str); - }); - }); + var validateSlug = function (wordCount, str) { + assert.strictEqual(1, str.match(/^[a-z][a-z-]*[a-z]$/).length); + assert.strictEqual(wordCount - 1, str.match(/-/g).length); + }; - context("when 'wordCount' param passed in", function () { - it("returns a slug with requested number of words", function () { - var str = faker.lorem.slug(7); - validateSlug(7, str); - }); - }); + context("when no 'wordCount' param passed in", function () { + it("returns a slug with three words", function () { + var str = faker.lorem.slug(); + validateSlug(3, str); + }); + }); + context("when 'wordCount' param passed in", function () { + it("returns a slug with requested number of words", function () { + var str = faker.lorem.slug(7); + validateSlug(7, str); + }); }); - /* + }); + + /* describe("sentence()", function () { context("when no 'wordCount' or 'range' param passed in", function () { it("returns a string of at least three words", function () { @@ -136,7 +136,7 @@ describe("lorem.js", function () { }); }); */ - /* + /* describe("sentences()", function () { context("when no 'sentenceCount' param passed in", function () { it("returns newline-separated string of three sentences", function () { @@ -166,7 +166,7 @@ describe("lorem.js", function () { }); }); */ - /* + /* describe("paragraph()", function () { context("when no 'wordCount' param passed in", function () { it("returns a string of at least three sentences", function () { @@ -202,7 +202,7 @@ describe("lorem.js", function () { }); */ - /* + /* describe("paragraphs()", function () { context("when no 'paragraphCount' param passed in", function () { |
