diff --git a/addon/ng2/blueprints/component/index.js b/addon/ng2/blueprints/component/index.js index 15cf21c47465..784e6ceb7230 100644 --- a/addon/ng2/blueprints/component/index.js +++ b/addon/ng2/blueprints/component/index.js @@ -4,7 +4,7 @@ var Blueprint = require('ember-cli/lib/models/blueprint'); var dynamicPathParser = require('../../utilities/dynamic-path-parser'); var addBarrelRegistration = require('../../utilities/barrel-management'); var getFiles = Blueprint.prototype.files; -const stringUtils = require('ember-cli/lib/utilities/string'); +const stringUtils = require('ember-cli-string-utils'); module.exports = { description: '', diff --git a/addon/ng2/blueprints/ng2/files/typings.json b/addon/ng2/blueprints/ng2/files/typings.json index 9760d097580e..a3cf3ddd3f14 100644 --- a/addon/ng2/blueprints/ng2/files/typings.json +++ b/addon/ng2/blueprints/ng2/files/typings.json @@ -1,12 +1,10 @@ { - "dependencies": {}, - "devDependencies": {}, "ambientDevDependencies": { - "angular-protractor": "github:DefinitelyTyped/DefinitelyTyped/angular-protractor/angular-protractor.d.ts#17fa1e5f269189f7f8e0f53f8c443e6c2eac562c", - "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#26c98c8a9530c44f8c801ccc3b2057e2101187ee", - "selenium-webdriver": "github:DefinitelyTyped/DefinitelyTyped/selenium-webdriver/selenium-webdriver.d.ts#a83677ed13add14c2ab06c7325d182d0ba2784ea" + "angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459", + "jasmine": "registry:dt/jasmine#2.2.0+20160412134438", + "selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654" }, "ambientDependencies": { - "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#6697d6f7dadbf5773cb40ecda35a76027e0783b2" + "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654" } } diff --git a/addon/ng2/blueprints/ng2/index.js b/addon/ng2/blueprints/ng2/index.js index 5a3b5cca6b1d..aadb0f96fb01 100644 --- a/addon/ng2/blueprints/ng2/index.js +++ b/addon/ng2/blueprints/ng2/index.js @@ -1,5 +1,5 @@ const path = require('path'); -const stringUtils = require('ember-cli/lib/utilities/string'); +const stringUtils = require('ember-cli-string-utils'); module.exports = { description: '', diff --git a/addon/ng2/blueprints/route/index.js b/addon/ng2/blueprints/route/index.js index 5e2293062e43..ed6345bc6291 100644 --- a/addon/ng2/blueprints/route/index.js +++ b/addon/ng2/blueprints/route/index.js @@ -3,7 +3,7 @@ const fs = require('fs'); const path = require('path'); const dynamicPathParser = require('../../utilities/dynamic-path-parser'); -const stringUtils = require('ember-cli/lib/utilities/string'); +const stringUtils = require('ember-cli-string-utils'); const Blueprint = require('ember-cli/lib/models/blueprint'); diff --git a/package.json b/package.json index c5169bef6f7a..604a64d33a4f 100644 --- a/package.json +++ b/package.json @@ -37,20 +37,21 @@ "broccoli-merge-trees": "^1.1.1", "broccoli-uglify-js": "^0.1.3", "broccoli-writer": "^0.1.1", - "chalk": "^1.1.1", - "ember-cli": "2.4.2", + "chalk": "^1.1.3", + "ember-cli": "2.5.0", + "ember-cli-string-utils": "^1.0.0", "exit": "^0.1.2", - "fs-extra": "^0.26.6", + "fs-extra": "^0.30.0", "glob": "^7.0.3", "leek": "0.0.21", - "lodash": "^4.6.1", + "lodash": "^4.11.1", "opn": "4.0.1", "resolve": "^1.1.7", - "shelljs": "^0.6.0", + "shelljs": "^0.7.0", "silent-error": "^1.0.0", - "symlink-or-copy": "^1.0.1", - "typescript": "^1.8.7", - "typings": "^0.7.9" + "symlink-or-copy": "^1.0.3", + "typescript": "^1.8.10", + "typings": "^0.8.1" }, "ember-addon": { "paths": [ @@ -59,8 +60,8 @@ }, "devDependencies": { "chai": "^3.5.0", - "clang-format": "^1.0.37", - "eslint": "^2.4.0", + "clang-format": "^1.0.38", + "eslint": "^2.8.0", "exists-sync": "0.0.3", "minimatch": "^3.0.0", "mocha": "^2.4.5", @@ -69,7 +70,7 @@ "rewire": "^2.5.1", "sinon": "^1.17.3", "through": "^2.3.8", - "tslint": "^3.6.0", + "tslint": "^3.8.1", "walk-sync": "^0.2.6" } } diff --git a/tests/acceptance/generate-component.spec.js b/tests/acceptance/generate-component.spec.js index 60eb00e376a6..bbd514a622be 100644 --- a/tests/acceptance/generate-component.spec.js +++ b/tests/acceptance/generate-component.spec.js @@ -10,6 +10,7 @@ var tmp = require('../helpers/tmp'); var root = process.cwd(); var conf = require('ember-cli/tests/helpers/conf'); var Promise = require('ember-cli/lib/ext/promise'); +var SilentError = require('silent-error'); describe('Acceptance: ng generate component', function () { before(conf.setup); @@ -134,8 +135,9 @@ describe('Acceptance: ng generate component', function () { it('ng generate component ..' + path.sep + 'my-comp from root dir will fail', () => { return ng(['generate', 'component', '..' + path.sep + 'my-comp']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '..', 'my-comp', 'my-comp.component.ts'); - expect(existsSync(testPath)).to.equal(false); + throw new SilentError(`ng generate component ..${path.sep}my-comp from root dir should fail.`); + }, (err) => { + expect(err).to.equal(`Invalid path: "..${path.sep}my-comp" cannot be above the "src${path.sep}client${path.sep}app" directory`); }); }); diff --git a/tests/acceptance/generate-directive.spec.js b/tests/acceptance/generate-directive.spec.js index 1ff24f6f2e62..76301bdd5b23 100644 --- a/tests/acceptance/generate-directive.spec.js +++ b/tests/acceptance/generate-directive.spec.js @@ -10,6 +10,7 @@ var tmp = require('../helpers/tmp'); var root = process.cwd(); var conf = require('ember-cli/tests/helpers/conf'); var Promise = require('ember-cli/lib/ext/promise'); +var SilentError = require('silent-error'); describe('Acceptance: ng generate directive', function () { before(conf.setup); @@ -144,8 +145,9 @@ describe('Acceptance: ng generate directive', function () { it('ng generate directive ..' + path.sep + 'my-dir from root dir will fail', () => { return ng(['generate', 'directive', '..' + path.sep + 'my-dir']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '..', 'my-dir', 'my-dir.directive.ts'); - expect(existsSync(testPath)).to.equal(false); + throw new SilentError(`ng generate directive ..${path.sep}my-dir from root dir should fail.`); + }, (err) => { + expect(err).to.equal(`Invalid path: "..${path.sep}my-dir" cannot be above the "src${path.sep}client${path.sep}app" directory`); }); }); }); diff --git a/tests/acceptance/generate-pipe.spec.js b/tests/acceptance/generate-pipe.spec.js index 2809881e23c0..b021f5db544c 100644 --- a/tests/acceptance/generate-pipe.spec.js +++ b/tests/acceptance/generate-pipe.spec.js @@ -10,6 +10,7 @@ var tmp = require('../helpers/tmp'); var root = process.cwd(); var conf = require('ember-cli/tests/helpers/conf'); var Promise = require('ember-cli/lib/ext/promise'); +var SilentError = require('silent-error'); describe('Acceptance: ng generate pipe', function () { before(conf.setup); @@ -133,8 +134,9 @@ describe('Acceptance: ng generate pipe', function () { it('ng generate pipe ..' + path.sep + 'my-pipe from root dir will fail', () => { return ng(['generate', 'pipe', '..' + path.sep + 'my-pipe']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '..', 'my-pipe.pipe.ts'); - expect(existsSync(testPath)).to.equal(false); + throw new SilentError(`ng generate pipe ..${path.sep}my-pipe from root dir should fail.`); + }, (err) => { + expect(err).to.equal(`Invalid path: "..${path.sep}my-pipe" cannot be above the "src${path.sep}client${path.sep}app" directory`); }); }); }); diff --git a/tests/acceptance/generate-service.spec.js b/tests/acceptance/generate-service.spec.js index e2bc9fc102ec..0909beda3215 100644 --- a/tests/acceptance/generate-service.spec.js +++ b/tests/acceptance/generate-service.spec.js @@ -10,6 +10,7 @@ var tmp = require('../helpers/tmp'); var root = process.cwd(); var conf = require('ember-cli/tests/helpers/conf'); var Promise = require('ember-cli/lib/ext/promise'); +var SilentError = require('silent-error'); describe('Acceptance: ng generate service', function () { before(conf.setup); @@ -136,8 +137,9 @@ describe('Acceptance: ng generate service', function () { it('ng generate service ..' + path.sep + 'my-svc from root dir will fail', () => { return ng(['generate', 'service', '..' + path.sep + 'my-svc']).then(() => { - var testPath = path.join(root, 'tmp', 'foo', 'src', 'client', 'app', '..', 'my-svc.service.ts'); - expect(existsSync(testPath)).to.equal(false); + throw new SilentError(`ng generate service ..${path.sep}my-svc from root dir should fail.`); + }, (err) => { + expect(err).to.equal(`Invalid path: "..${path.sep}my-svc" cannot be above the "src${path.sep}client${path.sep}app" directory`); }); }); }); diff --git a/tests/acceptance/github-pages-deploy.spec.js b/tests/acceptance/github-pages-deploy.spec.js index 09bdc06dfc44..c745a436551e 100644 --- a/tests/acceptance/github-pages-deploy.spec.js +++ b/tests/acceptance/github-pages-deploy.spec.js @@ -11,6 +11,7 @@ var chai = require('chai'); var sinon = require('sinon'); var ExecStub = require('../helpers/exec-stub'); var https = require('https'); +var SilentError = require('silent-error'); const expect = chai.expect; const fsReadFile = Promise.denodeify(fs.readFile); @@ -58,7 +59,12 @@ describe('Acceptance: ng github-pages:deploy', function() { it('should fail with uncommited changes', function() { execStub.addExecSuccess('git status --porcelain', 'M dir/file.ext'); return ng(['github-pages:deploy', '--skip-build']) - .then((ret) => expect(ret).to.equal(1)) + .then(() => { + throw new SilentError('Should fail with uncommited changes but passing.'); + }, (ret) => { + expect(ret.name).to.equal('SilentError'); + expect(ret.isSilentError).to.equal(true); + }); }); it('should deploy with defaults to existing remote', function() { @@ -226,7 +232,12 @@ describe('Acceptance: ng github-pages:deploy', function() { return ng(['github-pages:deploy', '--skip-build', `--gh-token=${token}`, `--gh-username=${username}`]) - .then((ret) => expect(ret).to.equal(1)) + .then(() => { + throw new SilentError('Should not pass the deploy.'); + }, (ret) => { + expect(ret.name).to.equal('SilentError'); + expect(ret.isSilentError).to.equal(true); + }) .then(() => httpsStub.restore()); }); }); diff --git a/tests/acceptance/new.spec.js b/tests/acceptance/new.spec.js index 315b0c1dde85..ef3b0f7d85d9 100644 --- a/tests/acceptance/new.spec.js +++ b/tests/acceptance/new.spec.js @@ -13,6 +13,7 @@ var root = process.cwd(); var util = require('util'); var conf = require('ember-cli/tests/helpers/conf'); var EOL = require('os').EOL; +var SilentError = require('silent-error'); describe('Acceptance: ng new', function () { before(conf.setup); @@ -64,12 +65,12 @@ describe('Acceptance: ng new', function () { return ng(['new', 'foo', '--skip-npm', '--skip-bower']).then(confirmBlueprinted); }); - it('ng new with empty app name doesnt throw exception', function () { - return ng(['new', '']); + it('ng new with empty app does throw exception', function () { + expect(ng(['new', ''])).to.throw; }); - it('ng new without app name doesnt throw exception', function () { - return ng(['new']); + it('ng new without app name does throw exception', function () { + expect(ng(['new', ''])).to.throw; }); it('ng new with app name creates new directory and has a dasherized package name', function () { @@ -84,9 +85,11 @@ describe('Acceptance: ng new', function () { it('Cannot run ng new, inside of ember-cli project', function () { return ng(['new', 'foo', '--skip-npm', '--skip-bower', '--skip-git']) .then(function () { - return ng(['new', 'foo', '--skip-npm', '--skip-bower', '--skip-git']).then(function () { + return ng(['new', 'foo', '--skip-npm', '--skip-bower', '--skip-git']).then(() => { + throw new SilentError('Cannot run ng new, inside of ember-cli project should fail.'); + }, () => { expect(!existsSync('foo')); - }); + }) }) .then(confirmBlueprinted); }); diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index 8e4587a20305..97e1c4a24585 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -68,7 +68,7 @@ describe('Basic end-to-end Workflow', function () { var envContent = fs.readFileSync(envPath, { encoding: 'utf8' }); expect(envContent).to.include('production:true'); // Also does not create new things in GIT. - expect(sh.exec('git status --porcelain').output).to.be.equal(''); + expect(sh.exec('git status --porcelain').output).to.be.equal(undefined); }); it('Can run `ng build` in created project', function () { @@ -80,7 +80,7 @@ describe('Basic end-to-end Workflow', function () { }) .then(function () { // Also does not create new things in GIT. - expect(sh.exec('git status --porcelain').output).to.be.equal(''); + expect(sh.exec('git status --porcelain').output).to.be.equal(undefined); }) .catch(() => { throw new Error('Build failed.');