diff options
| author | Shinigami <[email protected]> | 2022-01-13 12:23:30 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-13 12:23:30 +0100 |
| commit | d9b6e5d584f92da4ca059f2705530e609525265e (patch) | |
| tree | 378368b7f17ebb3bc84f49d75ea384ac61f270a3 /test/git.unit.js | |
| parent | 71e902599651b645cdb6996c8cd562e8007a32ea (diff) | |
| download | faker-d9b6e5d584f92da4ca059f2705530e609525265e.tar.xz faker-d9b6e5d584f92da4ca059f2705530e609525265e.zip | |
chore: format tests (#67)
Diffstat (limited to 'test/git.unit.js')
| -rw-r--r-- | test/git.unit.js | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/test/git.unit.js b/test/git.unit.js index 46e25724..ac3cd828 100644 --- a/test/git.unit.js +++ b/test/git.unit.js @@ -4,19 +4,19 @@ if (typeof module !== 'undefined') { var faker = require('../index'); } -describe("git.js", function() { - describe("branch()", function() { - beforeEach(function() { +describe('git.js', function () { + describe('branch()', function () { + beforeEach(function () { sinon.spy(faker.hacker, 'noun'); sinon.spy(faker.hacker, 'verb'); }); - afterEach(function() { + afterEach(function () { faker.hacker.noun.restore(); faker.hacker.verb.restore(); }); - it("returns a branch with hacker noun and verb", function() { + it('returns a branch with hacker noun and verb', function () { faker.git.branch(); assert.ok(faker.hacker.noun.calledOnce); @@ -24,8 +24,8 @@ describe("git.js", function() { }); }); - describe("commitEntry()", function() { - beforeEach(function() { + describe('commitEntry()', function () { + beforeEach(function () { sinon.spy(faker.git, 'commitMessage'); sinon.spy(faker.git, 'commitSha'); sinon.spy(faker.internet, 'email'); @@ -34,7 +34,7 @@ describe("git.js", function() { sinon.spy(faker.datatype, 'number'); }); - afterEach(function() { + afterEach(function () { faker.git.commitMessage.restore(); faker.git.commitSha.restore(); faker.internet.email.restore(); @@ -43,42 +43,42 @@ describe("git.js", function() { faker.datatype.number.restore(); }); - it("returns merge entry at random", function() { + it('returns merge entry at random', function () { faker.git.commitEntry(); assert.ok(faker.datatype.number.called); }); - it("returns a commit entry with git commit message and sha", function() { + it('returns a commit entry with git commit message and sha', function () { faker.git.commitEntry(); assert.ok(faker.git.commitMessage.calledOnce); assert.ok(faker.git.commitSha.calledOnce); }); - it("returns a commit entry with internet email", function() { + it('returns a commit entry with internet email', function () { faker.git.commitEntry(); assert.ok(faker.internet.email.calledOnce); }); - it("returns a commit entry with name first and last", function() { + it('returns a commit entry with name first and last', function () { faker.git.commitEntry(); assert.ok(faker.name.firstName.calledTwice); assert.ok(faker.name.lastName.calledTwice); }); - context("with options['merge'] equal to true", function() { - beforeEach(function() { + context("with options['merge'] equal to true", function () { + beforeEach(function () { sinon.spy(faker.git, 'shortSha'); }); - afterEach(function() { + afterEach(function () { faker.git.shortSha.restore(); }); - it("returns a commit entry with merge details", function() { + it('returns a commit entry with merge details', function () { faker.git.commitEntry({ merge: true }); assert.ok(faker.git.shortSha.calledTwice); @@ -86,20 +86,20 @@ describe("git.js", function() { }); }); - describe("commitMessage()", function() { - beforeEach(function() { + describe('commitMessage()', function () { + beforeEach(function () { sinon.spy(faker.hacker, 'verb'); sinon.spy(faker.hacker, 'adjective'); sinon.spy(faker.hacker, 'noun'); }); - afterEach(function() { + afterEach(function () { faker.hacker.verb.restore(); faker.hacker.adjective.restore(); faker.hacker.noun.restore(); }); - it("returns a commit message with hacker noun, adj and verb", function() { + it('returns a commit message with hacker noun, adj and verb', function () { faker.git.commitMessage(); assert.ok(faker.hacker.verb.calledOnce); @@ -108,16 +108,15 @@ describe("git.js", function() { }); }); - - describe("commitSha()", function() { - it("returns a random commit SHA", function() { + describe('commitSha()', function () { + it('returns a random commit SHA', function () { var commitSha = faker.git.commitSha(); assert.ok(commitSha.match(/^[a-f0-9]{40}$/)); }); }); - describe("shortSha()", function() { - it("returns a random short SHA", function() { + describe('shortSha()', function () { + it('returns a random short SHA', function () { var shortSha = faker.git.shortSha(); assert.ok(shortSha.match(/^[a-f0-9]{7}$/)); }); |
