UNPKG

@titanium/turbo

Version:

<p align="center"> <img src="https://cdn.secure-api.org/images/turbo-title_400.png" /><br> <a href="https://www.npmjs.com/package/@titanium/turbo"> <img src="https://img.shields.io/npm/v/@titanium/turbo.png" /> </a> </p>

68 lines (55 loc) 2.08 kB
var path = require('path'), exec = require('child_process').exec, TU = require('../lib/testUtils'); var alloyRoot = path.join(__dirname,'..','..'); var templatePath = path.join(alloyRoot,'Alloy','template'); var Harness = path.join(alloyRoot,'test','projects','Harness'); describe('alloy copy', function() { TU.addMatchers(); it('exits with error, shows help', function() { TU.asyncExecTest('alloy copy', { test: function() { expect(this.output.error).not.toBeNull(); } }); }); it('exits with error when given an invalid source', function() { TU.asyncExecTest('alloy copy invalidSource', { test: function() { expect(this.output.error).not.toBeNull(); } }); }); it('exits with error when given an invalid source and destination', function() { TU.asyncExecTest('alloy copy invalidSource invalidDestination', { test: function() { expect(this.output.error).not.toBeNull(); } }); }); var destinationName = 'testDestination'; it('copy without error', function() { TU.asyncExecTest('alloy copy index ' + destinationName + ' --project-dir "' + Harness + '"', {reset:true}); }); it('ends in error when does not exists source file', function() { TU.asyncExecTest('alloy copy doesNotExistsSource ' + destinationName + ' --project-dir "' + Harness + '"', { test: function() { expect(this.output.error).toBeTruthy(); } }); }); it('ends in error when exists destination file', function() { TU.asyncExecTest('alloy copy index ' + destinationName + ' --project-dir "' + Harness + '"', { test: function() { expect(this.output.error).toBeTruthy(); } }); }); it('copy without error when exists destination file force options', function() { TU.asyncExecTest('alloy copy index ' + destinationName + ' --project-dir "' + Harness + '" --force', {reset:true}); }); var recursiveDestinationName = 'recursive/testDestination'; it('recursive copy without error', function() { TU.asyncExecTest('alloy copy index ' + recursiveDestinationName + ' --project-dir "' + Harness + '"', {reset:true}); }); });