Skip to content

Commit

Permalink
Merge 7af31a3 into e44f600
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner committed Jul 22, 2015
2 parents e44f600 + 7af31a3 commit 8601853
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 97 deletions.
4 changes: 2 additions & 2 deletions lib/models/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ Command.prototype.validateAndRun = function(args) {
if (this.works === 'insideProject' && !this.isWithinProject) {
this.ui.writeLine('You have to be inside an ember-cli project in order to use ' +
'the ' + chalk.green(this.name) + ' command.');
return Promise.resolve();
return Promise.reject(1);
}

if (this.works === 'outsideProject' && this.isWithinProject) {
this.ui.writeLine('You cannot use the '+ chalk.green(this.name) +
' command inside an ember-cli project.');
return Promise.resolve();
return Promise.reject(1);
}

if (this.works === 'insideProject') {
Expand Down
55 changes: 3 additions & 52 deletions tests/acceptance/brocfile-smoke-test-slow.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,27 @@ var existsSync = require('exists-sync');
var appName = 'some-cool-app';

describe('Acceptance: brocfile-smoke-test', function() {
this.timeout(400000);

before(function() {
this.timeout(360000);
return createTestTargets(appName);
});

after(function() {
this.timeout(15000);
return teardownTestTargets();
});

beforeEach(function() {
this.timeout(360000);
return linkDependencies(appName);
});

afterEach(function() {
this.timeout(15000);
return cleanupRun().then(function() {
assertDirEmpty('tmp');
});
});

it('a custom EmberENV in config/environment.js is used for window.EmberENV', function() {
this.timeout(450000);


return copyFixtureFiles('brocfile-tests/custom-ember-env')
.then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build', '--silent');
Expand All @@ -63,26 +58,20 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('a custom environment config can be used in Brocfile.js', function() {
this.timeout(450000);

return copyFixtureFiles('brocfile-tests/custom-environment-config')
.then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'test', '--silent');
});
});

it('using wrapInEval: true', function() {
this.timeout(450000);

return copyFixtureFiles('brocfile-tests/wrap-in-eval')
.then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'test', '--silent');
});
});

it('without app/templates', function() {
this.timeout(450000);

return copyFixtureFiles('brocfile-tests/pods-templates')
.then(function(){
// remove ./app/templates
Expand All @@ -93,8 +82,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('strips app/styles or app/templates from JS', function() {
this.timeout(450000);

return copyFixtureFiles('brocfile-tests/styles-and-templates-stripped')
.then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build');
Expand All @@ -110,7 +97,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('should fall back to the Brocfile', function() {
this.timeout(100000);
return copyFixtureFiles('brocfile-tests/no-ember-cli-build').then(function() {
fs.removeSync('./ember-cli-build.js');
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build', '--silent');
Expand All @@ -121,7 +107,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('should use the Brocfile if both a Brocfile and ember-cli-build exist', function() {
this.timeout(100000);
return copyFixtureFiles('brocfile-tests/both-build-files').then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build', '--silent');
}).then(function(result) {
Expand All @@ -137,17 +122,13 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('should throw if no build file is found', function() {
this.timeout(100000);

fs.removeSync('./ember-cli-build.js');
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build', '--silent').catch(function(err) {
expect(err.code).to.eql(1);
});
});

it('using autoRun: true', function() {
this.timeout(100000);

return copyFixtureFiles('brocfile-tests/auto-run-true')
.then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build', '--silent');
Expand All @@ -162,7 +143,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('using autoRun: false', function() {
this.timeout(100000);

return copyFixtureFiles('brocfile-tests/auto-run-false')
.then(function() {
Expand All @@ -178,26 +158,20 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('default development build does not fail', function() {
this.timeout(100000);

return copyFixtureFiles('brocfile-tests/query')
.then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build', '--silent');
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build');
});
});

it('default development build tests', function() {
this.timeout(450000);

return copyFixtureFiles('brocfile-tests/default-development')
.then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'test', '--silent');
});
});

it('app.import works properly with non-js/css files', function() {
this.timeout(100000);

return copyFixtureFiles('brocfile-tests/app-import')
.then(function() {
var packageJsonPath = path.join(__dirname, '..', '..', 'tmp', appName, 'package.json');
Expand All @@ -219,8 +193,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('app.import fails when options.type is not `vendor` or `test`', function(){
this.timeout(100000);

return copyFixtureFiles('brocfile-tests/app-import')
.then(function() {
var packageJsonPath = path.join(__dirname, '..', '..', 'tmp', appName, 'package.json');
Expand All @@ -240,8 +212,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('addons can have a public tree that is merged and returned namespaced by default', function() {
this.timeout(100000);

return copyFixtureFiles('brocfile-tests/public-tree')
.then(function() {
var packageJsonPath = path.join(__dirname, '..', '..', 'tmp', appName, 'package.json');
Expand All @@ -263,26 +233,20 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('using pods based templates', function() {
this.timeout(450000);

return copyFixtureFiles('brocfile-tests/pods-templates')
.then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'test', '--silent');
});
});

it('using pods based templates with a podModulePrefix', function() {
this.timeout(450000);

return copyFixtureFiles('brocfile-tests/pods-with-prefix-templates')
.then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'test', '--silent');
});
});

it('addon trees are not jshinted', function() {
this.timeout(450000);

return copyFixtureFiles('brocfile-tests/jshint-addon')
.then(function() {
var packageJsonPath = path.join(__dirname, '..', '..', 'tmp', appName, 'package.json');
Expand All @@ -308,8 +272,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('specifying custom output paths works properly', function() {
this.timeout(100000);

return copyFixtureFiles('brocfile-tests/custom-output-paths')
.then(function () {
var themeCSSPath = path.join(__dirname, '..', '..', 'tmp', appName, 'app', 'styles', 'theme.css');
Expand Down Expand Up @@ -338,8 +300,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('multiple css files in app/styles/ are output when a preprocessor is not used', function() {
this.timeout(100000);

return copyFixtureFiles('brocfile-tests/multiple-css-files')
.then(function() {
return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build', '--silent');
Expand All @@ -358,9 +318,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('specifying partial `outputPaths` hash deep merges options correctly', function() {

this.timeout(100000);

return copyFixtureFiles('brocfile-tests/custom-output-paths')
.then(function () {

Expand Down Expand Up @@ -400,8 +357,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('multiple paths can be CSS preprocessed', function() {
this.timeout(100000);

return copyFixtureFiles('brocfile-tests/multiple-sass-files')
.then(function() {
var packageJsonPath = path.join(__dirname, '..', '..', 'tmp', appName, 'package.json');
Expand All @@ -427,8 +382,6 @@ describe('Acceptance: brocfile-smoke-test', function() {
});

it('app.css is output to <app name>.css by default', function() {
this.timeout(100000);

return runCommand(path.join('.', 'node_modules', 'ember-cli', 'bin', 'ember'), 'build', '--silent')
.then(function() {
var exists = existsSync(path.join('.', 'dist', 'assets', appName + '.css'));
Expand All @@ -439,8 +392,6 @@ describe('Acceptance: brocfile-smoke-test', function() {

// for backwards compat.
it('app.scss is output to <app name>.css by default', function() {
this.timeout(100000);

return copyFixtureFiles('brocfile-tests/multiple-sass-files')
.then(function() {
var brocfilePath = path.join(__dirname, '..', '..', 'tmp', appName, 'ember-cli-build.js');
Expand Down

0 comments on commit 8601853

Please sign in to comment.