Skip to content

fix(tests): use current package in e2e tests #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/e2e/e2e_workflow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ describe('Basic end-to-end Workflow', function () {
it('Installs angular-cli correctly', function() {
this.timeout(300000);

sh.exec('npm link', { silent: true });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to pass in the path to angular-cli?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I got this correctly, tests are always initiated from the root, which is why the setup with tmp dir works.

Although to be perfectly honest I couldn't find what the -C flag in npm install did in the command I removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm pretty sure you need to pass in the path to angular-cli.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm link doesn't seem to take a path to link globally, only to link locally. Is there a missing argument in these docs that you know of?

return tmp.setup('./tmp')
.then(function () {
process.chdir('./tmp');

sh.exec('npm i angular-cli -g -C ' + process.cwd(), { silent: true });
expect(fs.existsSync(path.join(process.cwd(), 'bin', 'ng')));
});
});
Expand All @@ -41,9 +40,10 @@ describe('Basic end-to-end Workflow', function () {

it('Can change current working directory to `test-project`', function() {
process.chdir(path.join(root, 'test-project'));
sh.exec('npm link ../../angular-cli', { silent: true });
expect(path.basename(process.cwd())).to.equal('test-project');
});

it('Can run `ng build` in created project', function() {
this.timeout(10000);

Expand Down