Skip to content

Commit 8ea2e72

Browse files
committed
bugfix: fix broken tests
1 parent bdb8690 commit 8ea2e72

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

tests/e2e/e2e_workflow.spec.js

+4-13
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ var treeKill = require('tree-kill');
1111
var child_process = require('child_process');
1212
var ng = require('../helpers/ng');
1313
var root = path.join(process.cwd(), 'tmp');
14-
var repoPkgJson = require('../../package.json');
1514

1615
function existsSync(path) {
1716
try {
@@ -40,34 +39,26 @@ describe('Basic end-to-end Workflow', function () {
4039
}
4140

4241

43-
// We don't want to use npm link because then npm dependencies
44-
// that only exist in the project will not be accessible to CLI
45-
// This is particularly problematic for --mobile, which uses Universal
46-
// libs as part of the build process.
47-
// Instead, we'll pack CLI as a tarball
4842
it('Installs angular-cli correctly', function () {
4943
this.timeout(300000);
5044

51-
sh.exec('npm pack', { silent: true });
52-
expect(existsSync(path.join(process.cwd(), `angular-cli-${repoPkgJson.version}.tgz`)));
45+
sh.exec('npm link', { silent: true });
46+
5347
return tmp.setup('./tmp').then(function () {
5448
process.chdir('./tmp');
49+
expect(existsSync(path.join(process.cwd(), 'bin', 'ng')));
5550
});
5651
});
5752

5853

5954
it('Can create new project using `ng new test-project`', function () {
6055
this.timeout(4200000);
61-
let args = ['--skip-npm'];
56+
let args = ['--link-cli'];
6257
// If testing in the mobile matrix on Travis, create project with mobile flag
6358
if (isMobileTest()) {
6459
args = args.concat(['--mobile']);
6560
}
6661
return ng(['new', 'test-project'].concat(args)).then(function () {
67-
// Install Angular CLI from packed version
68-
let tarball = path.resolve(root, `../angular-cli-${repoPkgJson.version}.tgz`);
69-
sh.exec(`npm install && npm install ${tarball}`);
70-
sh.exec(`rm ${tarball}`);
7162
expect(existsSync(path.join(root, 'test-project')));
7263
});
7364
});

0 commit comments

Comments
 (0)