In some projects some common code is placed in shared repo outdise of the workspace
In this cases there is upper dir present in paths (..)
For those cases resolved path is absolute to dir that isn't staring with project root path,
and it results in weirdly truncated path in error messages
like instead of /project/root/../shared/module we get /project/root/d/module
this commit uses node implementation, that works fine for those cases
If the .nx-results file got into a bad state, then it caused CLI
commands to fail in a cryptic way due to yargs failing JSON parsing.
This included having an empty .nx-results file.
Now we treat this case as if there was no results file in the first place.
Cypress supports running the tests in a user-specified browser. This option was not exposed through
the Cypress builder before. This change will add this option in.
re #906
ng new myworkspacename --collection=@nrwl/schematics doesn't typically work and throws dep errors like `Cannot find module '@angular-devkit/schematics'`
Make `replaceAppNameWithPath` uses pattern matching while replacing the strings, making sure it does
not mess with the wrong properties or values. Example: `ui` was messing with `build` &&
`@angular-devkit/build-angular`.
fix#856
This is enables the use of Cypress as e2e test runner for a new
application in the Nx workspace.
The Cypress command is hidden as a flag in the main application
schematics. Meaning, the only thing needed to enable this feature is to
add the `--e2eTestRunner=cypress` flag at your command when creating
a new application.
Example:
```shell
$ ng generate application myApp --e2eTestRunner=cypress
```
By default `ng e2e my-app-e2e` will start Cypress in the application
mode. You will see the desktop application and will be able to check all
the tests and run them as you which.
If you want to run the Cypress tests in headless mode (while being on CI
for example), you can do so by passing the `--headless` to the command.
You will see all the test results live in the terminal.
```shell
$ ng e2e my-app-e2e --headless
```
The Cypress configuration files and folders are present in the new
`my-app-e2e` folder created. Every file are written in typescript and
will be compiled into the `/dist/apps/my-app-e2e` folder before starting
Cypress.
If you need to fine tunes the options of Cypress, you can do so by
modifying directly the `cypress.json` file in the related project.
The build steps are has follow:
• compile typescript files into javascript inside the
`/dist/app/my-app-e2e` folder
• build a dev server (using the default AngularCLI dev target build)
• run Cypress with the compiled e2e files
Screenshots and Videos will be accessible respectively in
`/dist/apps/homer-app-e2e/screenshots` and
`/dist/apps/homer-app-e2e/videos`.