Skip to content

Commit

Permalink
checking if service name is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Bougère committed Jan 4, 2018
1 parent 310f59f commit 48618d8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/plugins/create/create.test.js
Expand Up @@ -680,6 +680,12 @@ describe('Create', () => {
expect(dirContent).to.include('serverless.yml');
expect(dirContent).to.include('handler.js');
expect(dirContent).to.include('gitignore');

// check if the service was renamed
const serverlessYmlfileContent = fse
.readFileSync(path.join(distDir, 'serverless.yml')).toString();

expect((/service: aws-nodejs/).test(serverlessYmlfileContent)).to.equal(true);
});
});

Expand All @@ -695,6 +701,12 @@ describe('Create', () => {
expect(dirContent).to.include('serverless.yml');
expect(dirContent).to.include('handler.js');
expect(dirContent).to.include('gitignore');

// check if the service was renamed
const serverlessYmlfileContent = fse
.readFileSync(path.join(tmpDir, 'my-awesome-service', 'serverless.yml')).toString();

expect((/service: my-awesome-service/).test(serverlessYmlfileContent)).to.equal(true);
});
});
});
Expand Down

0 comments on commit 48618d8

Please sign in to comment.