From 1f27308c3fd780d5c0d8679a96a92a0ed88e4254 Mon Sep 17 00:00:00 2001 From: GuilleW Date: Tue, 8 Nov 2022 15:42:26 +0100 Subject: [PATCH 1/2] decaffeinate spec/help-spec --- spec/help-spec.coffee | 54 ------------------- spec/help-spec.js | 117 ++++++++++++++++++++---------------------- 2 files changed, 56 insertions(+), 115 deletions(-) delete mode 100644 spec/help-spec.coffee diff --git a/spec/help-spec.coffee b/spec/help-spec.coffee deleted file mode 100644 index fec63f20..00000000 --- a/spec/help-spec.coffee +++ /dev/null @@ -1,54 +0,0 @@ -apm = require '../lib/apm-cli' - -describe 'command help', -> - beforeEach -> - spyOnToken() - silenceOutput() - - describe "apm help publish", -> - it "displays the help for the command", -> - callback = jasmine.createSpy('callback') - apm.run(['help', 'publish'], callback) - - waitsFor 'waiting for help to complete', 60000, -> - callback.callCount is 1 - - runs -> - expect(console.error.callCount).toBeGreaterThan 0 - expect(callback.mostRecentCall.args[0]).toBeUndefined() - - describe "apm publish -h", -> - it "displays the help for the command", -> - callback = jasmine.createSpy('callback') - apm.run(['publish', '-h'], callback) - - waitsFor 'waiting for help to complete', 60000, -> - callback.callCount is 1 - - runs -> - expect(console.error.callCount).toBeGreaterThan 0 - expect(callback.mostRecentCall.args[0]).toBeUndefined() - - describe "apm help", -> - it "displays the help for apm", -> - callback = jasmine.createSpy('callback') - apm.run(['help'], callback) - - waitsFor 'waiting for help to complete', 60000, -> - callback.callCount is 1 - - runs -> - expect(console.error.callCount).toBeGreaterThan 0 - expect(callback.mostRecentCall.args[0]).toBeUndefined() - - describe "apm", -> - it "displays the help for apm", -> - callback = jasmine.createSpy('callback') - apm.run([], callback) - - waitsFor 'waiting for help to complete', 60000, -> - callback.callCount is 1 - - runs -> - expect(console.error.callCount).toBeGreaterThan 0 - expect(callback.mostRecentCall.args[0]).toBeUndefined() diff --git a/spec/help-spec.js b/spec/help-spec.js index 15320ef7..cdb2332d 100644 --- a/spec/help-spec.js +++ b/spec/help-spec.js @@ -1,61 +1,56 @@ -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md - */ -const apm = require('../lib/apm-cli'); - -describe('command help', function() { - beforeEach(function() { - spyOnToken(); - return silenceOutput(); - }); - - describe("apm help publish", () => it("displays the help for the command", function() { - const callback = jasmine.createSpy('callback'); - apm.run(['help', 'publish'], callback); - - waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1); - - return runs(function() { - expect(console.error.callCount).toBeGreaterThan(0); - return expect(callback.mostRecentCall.args[0]).toBeUndefined(); - }); - })); - - describe("apm publish -h", () => it("displays the help for the command", function() { - const callback = jasmine.createSpy('callback'); - apm.run(['publish', '-h'], callback); - - waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1); - - return runs(function() { - expect(console.error.callCount).toBeGreaterThan(0); - return expect(callback.mostRecentCall.args[0]).toBeUndefined(); - }); - })); - - describe("apm help", () => it("displays the help for apm", function() { - const callback = jasmine.createSpy('callback'); - apm.run(['help'], callback); - - waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1); - - return runs(function() { - expect(console.error.callCount).toBeGreaterThan(0); - return expect(callback.mostRecentCall.args[0]).toBeUndefined(); - }); - })); - - return describe("apm", () => it("displays the help for apm", function() { - const callback = jasmine.createSpy('callback'); - apm.run([], callback); - - waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1); - - return runs(function() { - expect(console.error.callCount).toBeGreaterThan(0); - return expect(callback.mostRecentCall.args[0]).toBeUndefined(); - }); - })); -}); +const apm = require('../lib/apm-cli') + +describe('command help', () => { + beforeEach(() => { + spyOnToken() + silenceOutput() + }) + + describe('apm help publish', () => { + it('displays the help for the command', () => { + const callback = jasmine.createSpy('callback') + apm.run(['help', 'publish'], callback) + waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1) + runs(() => { + expect(console.error.callCount).toBeGreaterThan(0) + expect(callback.mostRecentCall.args[0]).toBeUndefined() + }) + }) + }) + + describe('apm publish -h', () => { + it('displays the help for the command', () => { + const callback = jasmine.createSpy('callback') + apm.run(['publish', '-h'], callback) + waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1) + runs(() => { + expect(console.error.callCount).toBeGreaterThan(0) + expect(callback.mostRecentCall.args[0]).toBeUndefined() + }) + }) + }) + + describe('apm help', () => { + it('displays the help for apm', () => { + const callback = jasmine.createSpy('callback') + apm.run(['help'], callback) + waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1) + runs(() => { + expect(console.error.callCount).toBeGreaterThan(0) + expect(callback.mostRecentCall.args[0]).toBeUndefined() + }) + }) + }) + + describe('apm', () => { + it('displays the help for apm', () => { + const callback = jasmine.createSpy('callback') + apm.run([], callback) + waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1) + runs(() => { + expect(console.error.callCount).toBeGreaterThan(0) + expect(callback.mostRecentCall.args[0]).toBeUndefined() + }) + }) + }) +}) From 672a0aed337c5d8c6749144c83ed63d66209af14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Polg=C3=A1r=20M=C3=A1rton?= Date: Sun, 21 May 2023 10:33:27 +0200 Subject: [PATCH 2/2] Bringing semicolons back --- spec/help-spec.js | 74 +++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/spec/help-spec.js b/spec/help-spec.js index cdb2332d..c05d8cb9 100644 --- a/spec/help-spec.js +++ b/spec/help-spec.js @@ -1,56 +1,56 @@ -const apm = require('../lib/apm-cli') +const apm = require('../lib/apm-cli'); describe('command help', () => { beforeEach(() => { - spyOnToken() - silenceOutput() - }) + spyOnToken(); + silenceOutput(); + }); describe('apm help publish', () => { it('displays the help for the command', () => { - const callback = jasmine.createSpy('callback') - apm.run(['help', 'publish'], callback) - waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1) + const callback = jasmine.createSpy('callback'); + apm.run(['help', 'publish'], callback); + waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1); runs(() => { - expect(console.error.callCount).toBeGreaterThan(0) - expect(callback.mostRecentCall.args[0]).toBeUndefined() - }) - }) - }) + expect(console.error.callCount).toBeGreaterThan(0); + expect(callback.mostRecentCall.args[0]).toBeUndefined(); + }); + }); + }); describe('apm publish -h', () => { it('displays the help for the command', () => { - const callback = jasmine.createSpy('callback') - apm.run(['publish', '-h'], callback) - waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1) + const callback = jasmine.createSpy('callback'); + apm.run(['publish', '-h'], callback); + waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1); runs(() => { - expect(console.error.callCount).toBeGreaterThan(0) - expect(callback.mostRecentCall.args[0]).toBeUndefined() - }) - }) - }) + expect(console.error.callCount).toBeGreaterThan(0); + expect(callback.mostRecentCall.args[0]).toBeUndefined(); + }); + }); + }); describe('apm help', () => { it('displays the help for apm', () => { - const callback = jasmine.createSpy('callback') - apm.run(['help'], callback) - waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1) + const callback = jasmine.createSpy('callback'); + apm.run(['help'], callback); + waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1); runs(() => { - expect(console.error.callCount).toBeGreaterThan(0) - expect(callback.mostRecentCall.args[0]).toBeUndefined() - }) - }) - }) + expect(console.error.callCount).toBeGreaterThan(0); + expect(callback.mostRecentCall.args[0]).toBeUndefined(); + }); + }); + }); describe('apm', () => { it('displays the help for apm', () => { - const callback = jasmine.createSpy('callback') - apm.run([], callback) - waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1) + const callback = jasmine.createSpy('callback'); + apm.run([], callback); + waitsFor('waiting for help to complete', 60000, () => callback.callCount === 1); runs(() => { - expect(console.error.callCount).toBeGreaterThan(0) - expect(callback.mostRecentCall.args[0]).toBeUndefined() - }) - }) - }) -}) + expect(console.error.callCount).toBeGreaterThan(0); + expect(callback.mostRecentCall.args[0]).toBeUndefined(); + }); + }); + }); +});