From 1e45fab71b99ecb8a6c2c5b6cf3c415ece4524c8 Mon Sep 17 00:00:00 2001 From: Nana Amfo Date: Tue, 3 Oct 2017 17:18:50 -0500 Subject: [PATCH] added dockerignore to template; add unit test --- app/index.js | 1 + app/templates/{.dockerignore => _dockerignore} | 0 test/common.js | 1 + test/integration.js | 6 ++++++ 4 files changed, 8 insertions(+) rename app/templates/{.dockerignore => _dockerignore} (100%) diff --git a/app/index.js b/app/index.js index b15ba5a..cbd3a2a 100644 --- a/app/index.js +++ b/app/index.js @@ -110,6 +110,7 @@ module.exports = class extends Generator { this.fs.copyTpl(this.templatePath('test/test-server.js'), this.destinationPath('test/test-server.js'), this.options); this.fs.copyTpl(this.templatePath('test/test-demo.js'), this.destinationPath('test/test-demo.js'), this.options); this.fs.copyTpl(this.templatePath('_gitignore'), this.destinationPath('.gitignore'), this.options); + this.fs.copyTpl(this.templatePath('_dockerignore'), this.destinationPath('.dockerignore'), this.options); this.fs.copyTpl(this.templatePath('cli-config.yml'), this.destinationPath('cli-config.yml'), this.options); this.fs.copyTpl(this.templatePath('Dockerfile'), this.destinationPath('Dockerfile'), this.options); this.fs.copyTpl(this.templatePath('Dockerfile-tools'), this.destinationPath('Dockerfile-tools'), this.options); diff --git a/app/templates/.dockerignore b/app/templates/_dockerignore similarity index 100% rename from app/templates/.dockerignore rename to app/templates/_dockerignore diff --git a/test/common.js b/test/common.js index 8157d31..aad4a84 100644 --- a/test/common.js +++ b/test/common.js @@ -19,6 +19,7 @@ // Paths to the generated files, if you move files around change paths here. exports.file = { gitignore: '.gitignore', + dockerignore: '.dockerignore', package_json: 'package.json', README_md: 'README.md', server_js: 'server/server.js', diff --git a/test/integration.js b/test/integration.js index 9b99f33..b2321c3 100644 --- a/test/integration.js +++ b/test/integration.js @@ -295,6 +295,12 @@ describe('core-node-express:app integration test with custom bluemix and spec', assert.fileContent(common.file.gitignore, 'node_modules'); }); }); + + describe(common.file.dockerignore, function () { + it('contains node_modules', function () { + assert.fileContent(common.file.dockerignore, 'node_modules'); + }); + }); }); describe('core-node-express:app integration test with isDeployableContainer spec', function() {