From c718593162d525806fc3ea19fb23417ffd8a27c9 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 5 Jun 2016 16:56:07 +0200 Subject: [PATCH] add NpmciTest module tests --- test/test.js | 20 +++++++++++++++++++- test/test.ts | 20 +++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/test/test.js b/test/test.js index c8bf933..cb5883b 100644 --- a/test/test.js +++ b/test/test.js @@ -11,6 +11,7 @@ process.cwd = function () { }; //require NPMCI files var NpmciBuildDocker = require("../dist/npmci.build.docker"); +var NpmciTest = require("../dist/npmci.test"); var dockerfile1; var dockerfile2; var sortableArray; @@ -45,6 +46,23 @@ describe("NPMCI", function () { }); }); }); + describe(".test.npm", function () { + it("should source nvm using bash and install a specific node version", function (done) { + NpmciTest.test("legacy") + .then(function () { + return NpmciTest.test("lts"); + }) + .then(function () { + return NpmciTest.test("stable"); + }) + .then(function () { + return NpmciTest.test("docker"); + }) + .then(function () { + done(); + }); + }); + }); }); -//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FBYyxDQUFDLENBQUE7QUFDdEIsUUFBTyxRQUFRLENBQUMsQ0FBQTtBQUNoQixJQUFPLElBQUksV0FBVyxNQUFNLENBQUMsQ0FBQztBQUM5QixJQUFZLFNBQVMsV0FBTSxXQUUzQixDQUFDLENBRnFDO0FBQ3RDLG9CQUFvQjtBQUNwQixPQUFPLENBQUMsR0FBRyxDQUFDLGFBQWEsR0FBRyx1REFBdUQsQ0FBQztBQUNwRixPQUFPLENBQUMsR0FBRyxDQUFDLFVBQVUsR0FBRyxNQUFNLENBQUM7QUFDaEMsT0FBTyxDQUFDLEdBQUcsR0FBRztJQUNWLE1BQU0sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBQyxTQUFTLENBQUMsQ0FBQ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YWwoXCJzb21ldGFnMVwiKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBpdChcInNob3VsZCByZWFkIGEgZGlyZWN0b3J5IG9mIERvY2tlcmZpbGVzXCIsZnVuY3Rpb24oZG9uZSl7XHJcbiAgICAgICAgICAgIE5wbWNpQnVpbGREb2NrZXIucmVhZERvY2tlcmZpbGVzKClcclxuICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uKHJlYWREb2NrZXJmaWxlc0FycmF5QXJnOk5wbWNpQnVpbGREb2NrZXIuRG9ja2VyZmlsZVtdKXtcclxuICAgICAgICAgICAgICAgICAgICByZWFkRG9ja2VyZmlsZXNBcnJheUFyZ1sxXS52ZXJzaW9uLnNob3VsZC5lcXVhbChcInNvbWV0YWcxXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIHNvcnRhYmxlQXJyYXkgPSByZWFkRG9ja2VyZmlsZXNBcnJheUFyZ1xyXG4gICAgICAgICAgICAgICAgICAgIGRvbmUoKTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pXHJcbiAgICAgICAgaXQoXCJzaG91bGQgc29ydCBhbiBhcnJheSBvZiBEb2NrZXJmaWxlc1wiLGZ1bmN0aW9uKGRvbmUpe1xyXG4gICAgICAgICAgICBOcG1jaUJ1aWxkRG9ja2VyLnNvcnREb2NrZXJmaWxlcyhzb3J0YWJsZUFycmF5KVxyXG4gICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oc29ydGVkQXJyYXlBcmc6TnBtY2lCdWlsZERvY2tlci5Eb2NrZXJmaWxlW10pe1xyXG4gICAgICAgICAgICAgICAgICAgIGJlYXV0eWxvZy5zdWNjZXNzKFwiZmluYWwgcmVzdWx0XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHNvcnRlZEFycmF5QXJnKTtcclxuICAgICAgICAgICAgICAgICAgICBkb25lKCk7XHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICA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ICAgfSlcclxuICAgICAgICBpdChcInNob3VsZCBzb3J0IGFuIGFycmF5IG9mIERvY2tlcmZpbGVzXCIsZnVuY3Rpb24oZG9uZSl7XHJcbiAgICAgICAgICAgIE5wbWNpQnVpbGREb2NrZXIuc29ydERvY2tlcmZpbGVzKHNvcnRhYmxlQXJyYXkpXHJcbiAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbihzb3J0ZWRBcnJheUFyZzpOcG1jaUJ1aWxkRG9ja2VyLkRvY2tlcmZpbGVbXSl7XHJcbiAgICAgICAgICAgICAgICAgICAgYmVhdXR5bG9nLnN1Y2Nlc3MoXCJmaW5hbCByZXN1bHRcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coc29ydGVkQXJyYXlBcmcpO1xyXG4gICAgICAgICAgICAgICAgICAgIGRvbmUoKTtcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgaXQoXCJzaG91bGQgY29ycmVjdGx5IGNoYWluIERvY2tlcmZpbGUgaGFuZGxpbmdcIixmdW5jdGlvbihkb25lKXtcclxuICAgICAgICAgICAgTnBtY2lCdWlsZERvY2tlci5idWlsZCgpXHJcbiAgICAgICAgICAgICAgICAudGhlbigoKT0+e1xyXG4gICAgICAgICAgICAgICAgICAgIGRvbmUoKTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pXHJcbiAgICB9KTtcclxuICAgIGRlc2NyaWJlKFwiLnRlc3QubnBtXCIsZnVuY3Rpb24oKXtcclxuICAgICAgICBpdChcInNob3VsZCBzb3VyY2UgbnZtIHVzaW5nIGJhc2ggYW5kIGluc3RhbGwgYSBzcGVjaWZpYyBub2RlIHZlcnNpb25cIixmdW5jdGlvbihkb25lKXtcclxuICAgICAgICAgICAgTnBtY2lUZXN0LnRlc3QoXCJsZWdhY3lcIilcclxuICAgICAgICAgICAgICAgIC50aGVuKCgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gTnBtY2lUZXN0LnRlc3QoXCJsdHNcIik7XHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLnRoZW4oKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBOcG1jaVRlc3QudGVzdChcInN0YWJsZVwiKTtcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAudGhlbigoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBOcG1jaVRlc3QudGVzdChcImRvY2tlclwiKTtcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAudGhlbigoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgZG9uZSgpO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSlcclxuICAgIH0pO1xyXG59KSJdfQ== diff --git a/test/test.ts b/test/test.ts index e723026..25e9aba 100644 --- a/test/test.ts +++ b/test/test.ts @@ -11,6 +11,7 @@ process.cwd = () => { //require NPMCI files import NpmciBuildDocker = require("../dist/npmci.build.docker"); +import NpmciTest = require("../dist/npmci.test"); let dockerfile1:NpmciBuildDocker.Dockerfile; @@ -47,5 +48,22 @@ describe("NPMCI",function(){ done(); }); }) - }) + }); + describe(".test.npm",function(){ + it("should source nvm using bash and install a specific node version",function(done){ + NpmciTest.test("legacy") + .then(() => { + return NpmciTest.test("lts"); + }) + .then(() => { + return NpmciTest.test("stable"); + }) + .then(() => { + return NpmciTest.test("docker"); + }) + .then(() => { + done(); + }); + }) + }); }) \ No newline at end of file