Skip to content

Commit e252259

Browse files
committed
Fix linting issues
1 parent 5541f2b commit e252259

File tree

1 file changed

+74
-74
lines changed

1 file changed

+74
-74
lines changed

lib/classes/Service.test.js

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -733,60 +733,60 @@ describe('Service', () => {
733733
}
734734

735735
it(`should not throw an error if http event is absent and
736-
stage contains only alphanumeric, underscore and hyphen`, function () {
737-
this.timeout(10000); // Occasionally times out with default settings
738-
const SUtils = new Utils();
739-
const serverlessYml = {
740-
service: 'new-service',
741-
provider: {
742-
name: 'aws',
743-
stage: 'xyz-101_abc-123',
744-
},
745-
functions: {
746-
first: {
747-
events: [],
748-
},
736+
stage contains only alphanumeric, underscore and hyphen`, function () {
737+
this.timeout(10000); // Occasionally times out with default settings
738+
const SUtils = new Utils();
739+
const serverlessYml = {
740+
service: 'new-service',
741+
provider: {
742+
name: 'aws',
743+
stage: 'xyz-101_abc-123',
744+
},
745+
functions: {
746+
first: {
747+
events: [],
749748
},
750-
};
751-
SUtils.writeFileSync(path.join(tmpDirPath, 'serverless.yml'),
752-
YAML.dump(serverlessYml));
749+
},
750+
};
751+
SUtils.writeFileSync(path.join(tmpDirPath, 'serverless.yml'),
752+
YAML.dump(serverlessYml));
753753

754-
const serverless = new Serverless({ servicePath: tmpDirPath });
755-
return expect(simulateRun(serverless)).to.eventually.be.fulfilled.then(() => {
756-
expect(() => serverless.service.validate()).to.not.throw(serverless.classes.Error);
757-
});
754+
const serverless = new Serverless({ servicePath: tmpDirPath });
755+
return expect(simulateRun(serverless)).to.eventually.be.fulfilled.then(() => {
756+
expect(() => serverless.service.validate()).to.not.throw(serverless.classes.Error);
758757
});
758+
});
759759

760760
it(`should not throw an error after variable population if http event is present and
761-
the populated stage contains only alphanumeric, underscore and hyphen`, () => {
762-
const SUtils = new Utils();
763-
const serverlessYml = {
764-
service: 'new-service',
765-
provider: {
766-
name: 'aws',
767-
stage: '${opt:stage, "default-stage"}',
768-
},
769-
functions: {
770-
first: {
771-
events: [
772-
{
773-
http: {
774-
path: 'foo',
775-
method: 'GET',
776-
},
761+
the populated stage contains only alphanumeric, underscore and hyphen`, () => {
762+
const SUtils = new Utils();
763+
const serverlessYml = {
764+
service: 'new-service',
765+
provider: {
766+
name: 'aws',
767+
stage: '${opt:stage, "default-stage"}',
768+
},
769+
functions: {
770+
first: {
771+
events: [
772+
{
773+
http: {
774+
path: 'foo',
775+
method: 'GET',
777776
},
778-
],
779-
},
777+
},
778+
],
780779
},
781-
};
782-
SUtils.writeFileSync(path.join(tmpDirPath, 'serverless.yml'),
783-
YAML.dump(serverlessYml));
780+
},
781+
};
782+
SUtils.writeFileSync(path.join(tmpDirPath, 'serverless.yml'),
783+
YAML.dump(serverlessYml));
784784

785-
const serverless = new Serverless({ servicePath: tmpDirPath });
786-
return expect(simulateRun(serverless)).to.eventually.be.fulfilled.then(() => {
787-
expect(() => serverless.service.validate()).to.not.throw(serverless.classes.Error);
788-
});
785+
const serverless = new Serverless({ servicePath: tmpDirPath });
786+
return expect(simulateRun(serverless)).to.eventually.be.fulfilled.then(() => {
787+
expect(() => serverless.service.validate()).to.not.throw(serverless.classes.Error);
789788
});
789+
});
790790

791791
it('should throw an error if http event is present and stage contains invalid chars', () => {
792792
const SUtils = new Utils();
@@ -824,38 +824,38 @@ describe('Service', () => {
824824

825825
it(`should throw an error after variable population
826826
if http event is present and stage contains hyphen`, () => {
827-
const SUtils = new Utils();
828-
const serverlessYml = {
829-
service: 'new-service',
830-
provider: {
831-
name: 'aws',
832-
stage: '${opt:stage, "default:stage"}',
833-
},
834-
functions: {
835-
first: {
836-
events: [
837-
{
838-
http: {
839-
path: 'foo',
840-
method: 'GET',
841-
},
827+
const SUtils = new Utils();
828+
const serverlessYml = {
829+
service: 'new-service',
830+
provider: {
831+
name: 'aws',
832+
stage: '${opt:stage, "default:stage"}',
833+
},
834+
functions: {
835+
first: {
836+
events: [
837+
{
838+
http: {
839+
path: 'foo',
840+
method: 'GET',
842841
},
843-
],
844-
},
842+
},
843+
],
845844
},
846-
};
847-
SUtils.writeFileSync(path.join(tmpDirPath, 'serverless.yml'),
848-
YAML.dump(serverlessYml));
849-
850-
const serverless = new Serverless({ servicePath: tmpDirPath });
851-
return expect(simulateRun(serverless)).to.eventually.be.fulfilled.then(() => {
852-
expect(() => serverless.service.validate()).to.throw(serverless.classes.Error, [
853-
'Invalid stage name default:stage: it should contains only [-_a-zA-Z0-9]',
854-
'for AWS provider if http event are present',
855-
'according to API Gateway limitation.',
856-
].join(' '));
857-
});
845+
},
846+
};
847+
SUtils.writeFileSync(path.join(tmpDirPath, 'serverless.yml'),
848+
YAML.dump(serverlessYml));
849+
850+
const serverless = new Serverless({ servicePath: tmpDirPath });
851+
return expect(simulateRun(serverless)).to.eventually.be.fulfilled.then(() => {
852+
expect(() => serverless.service.validate()).to.throw(serverless.classes.Error, [
853+
'Invalid stage name default:stage: it should contains only [-_a-zA-Z0-9]',
854+
'for AWS provider if http event are present',
855+
'according to API Gateway limitation.',
856+
].join(' '));
858857
});
858+
});
859859
});
860860
});
861861

0 commit comments

Comments
 (0)